From 28f66b73dd1854143b0aa5716f4af3f31efbcefa Mon Sep 17 00:00:00 2001 From: Diwank Singh Tomer Date: Fri, 4 Oct 2024 18:35:48 -0400 Subject: [PATCH] fix: Minor fixes for typecheck Signed-off-by: Diwank Singh Tomer --- agents-api/agents_api/routers/agents/list_agents.py | 4 +++- agents-api/agents_api/routers/docs/list_docs.py | 8 ++++++-- agents-api/agents_api/routers/sessions/list_sessions.py | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/agents-api/agents_api/routers/agents/list_agents.py b/agents-api/agents_api/routers/agents/list_agents.py index aa6986d0d..a24f0667c 100644 --- a/agents-api/agents_api/routers/agents/list_agents.py +++ b/agents-api/agents_api/routers/agents/list_agents.py @@ -30,7 +30,9 @@ async def list_agents( offset=offset, sort_by=sort_by, direction=direction, - metadata_filter=metadata_filter.model_dump(mode="json"), + metadata_filter=metadata_filter.model_dump(mode="json") + if metadata_filter + else {}, ) return ListResponse[Agent](items=agents) diff --git a/agents-api/agents_api/routers/docs/list_docs.py b/agents-api/agents_api/routers/docs/list_docs.py index 0cd823919..f342f4b4b 100644 --- a/agents-api/agents_api/routers/docs/list_docs.py +++ b/agents-api/agents_api/routers/docs/list_docs.py @@ -32,7 +32,9 @@ async def list_user_docs( offset=offset, sort_by=sort_by, direction=direction, - metadata_filter=metadata_filter.model_dump(mode="json"), + metadata_filter=metadata_filter.model_dump(mode="json") + if metadata_filter + else {}, ) return ListResponse[Doc](items=docs) @@ -58,7 +60,9 @@ async def list_agent_docs( offset=offset, sort_by=sort_by, direction=direction, - metadata_filter=metadata_filter.model_dump(mode="json"), + metadata_filter=metadata_filter.model_dump(mode="json") + if metadata_filter + else {}, ) return ListResponse[Doc](items=docs) diff --git a/agents-api/agents_api/routers/sessions/list_sessions.py b/agents-api/agents_api/routers/sessions/list_sessions.py index ae011fb18..157b9f681 100644 --- a/agents-api/agents_api/routers/sessions/list_sessions.py +++ b/agents-api/agents_api/routers/sessions/list_sessions.py @@ -29,7 +29,9 @@ async def list_sessions( offset=offset, sort_by=sort_by, direction=direction, - metadata_filter=metadata_filter.model_dump(mode="json"), + metadata_filter=metadata_filter.model_dump(mode="json") + if metadata_filter + else {}, ) return ListResponse[Session](items=sessions)