From 3a139987cb218e2151b66842ef46afd4c481af14 Mon Sep 17 00:00:00 2001 From: Manthan Gupta Date: Mon, 30 Sep 2024 17:57:54 +0530 Subject: [PATCH] Feat: log agent sessions --- phi/playground/routes.py | 3 +++ phi/playground/schemas.py | 1 + 2 files changed, 4 insertions(+) diff --git a/phi/playground/routes.py b/phi/playground/routes.py index 9b68f63bf..8f1ffb2fe 100644 --- a/phi/playground/routes.py +++ b/phi/playground/routes.py @@ -77,6 +77,9 @@ def agent_chat(body: AgentRunRequest): if agent is None: raise HTTPException(status_code=404, detail="Agent not found") + if body.monitor: + agent.monitoring = True + base64_image: Optional[List[Union[str, Dict]]] = None if body.image: base64_image = process_image(body.image) diff --git a/phi/playground/schemas.py b/phi/playground/schemas.py index b0600a031..7a4c7cebb 100644 --- a/phi/playground/schemas.py +++ b/phi/playground/schemas.py @@ -27,6 +27,7 @@ class AgentRunRequest(BaseModel): message: str agent_id: str stream: bool = True + monitor: bool = False session_id: Optional[str] = None user_id: Optional[str] = None image: Optional[UploadFile] = None