From 54a0f2488e3d6c29064a7d57971385054daf8695 Mon Sep 17 00:00:00 2001 From: Diwank Singh Tomer Date: Mon, 14 Oct 2024 21:01:56 -0400 Subject: [PATCH] fix: Fix BoxList problem with vectors Signed-off-by: Diwank Singh Tomer --- agents-api/agents_api/activities/execute_system.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/agents-api/agents_api/activities/execute_system.py b/agents-api/agents_api/activities/execute_system.py index 8ffb85814..a9b9ea2bc 100644 --- a/agents-api/agents_api/activities/execute_system.py +++ b/agents-api/agents_api/activities/execute_system.py @@ -2,6 +2,7 @@ from uuid import UUID from beartype import beartype +from box import Box, BoxList from fastapi.background import BackgroundTasks from temporalio import activity @@ -19,9 +20,7 @@ from ..models.agent.get_agent import get_agent as get_agent_query from ..models.agent.list_agents import list_agents as list_agents_query from ..models.agent.update_agent import update_agent as update_agent_query -from ..models.docs.create_doc import create_doc as create_doc_query from ..models.docs.delete_doc import delete_doc as delete_doc_query -from ..models.docs.get_doc import get_doc as get_doc_query from ..models.docs.list_docs import list_docs as list_docs_query from ..models.session.create_session import create_session as create_session_query from ..models.session.delete_session import delete_session as delete_session_query @@ -50,6 +49,11 @@ async def execute_system( arguments = system.arguments arguments["developer_id"] = context.execution_input.developer_id + # Unbox all the arguments + for key, value in arguments.items(): + if isinstance(value, Box) or isinstance(value, BoxList): + arguments[key] = value.to_dict() + # Convert all UUIDs to UUID objects if "agent_id" in arguments: arguments["agent_id"] = UUID(arguments["agent_id"])