Initial travel knowledge graph release
This commit is contained in:
23
app/api/agent_call_logs.py
Normal file
23
app/api/agent_call_logs.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""Agent call log listing endpoint."""
|
||||
from fastapi import APIRouter, Depends, Query
|
||||
|
||||
from app.auth import CurrentUser
|
||||
from app.config import settings
|
||||
from app.db import get_conn
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/agent-call-logs")
|
||||
async def list_logs(
|
||||
_user: CurrentUser = None,
|
||||
limit: int = Query(default=100, le=500),
|
||||
):
|
||||
s = settings.db_schema
|
||||
async with get_conn() as conn:
|
||||
async with conn.cursor() as cur:
|
||||
await cur.execute(
|
||||
f"SELECT * FROM {s}.agent_call_logs ORDER BY created_at DESC LIMIT %s",
|
||||
(limit,),
|
||||
)
|
||||
return await cur.fetchall()
|
||||
Reference in New Issue
Block a user