Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

feat: add error codes to composio errors (#2290)

Shubham Naike9239cf1bf1a
diff --git a/letta/server/rest_api/routers/v1/tools.py b/letta/server/rest_api/routers/v1/tools.py
index 500e6fc86..d1287bc8b 100644
--- a/letta/server/rest_api/routers/v1/tools.py
+++ b/letta/server/rest_api/routers/v1/tools.py
@@ -243,6 +243,7 @@ def add_composio_tool(
raise HTTPException(
status_code=400, # Bad Request
detail={
+ "code": "EnumStringNotFound",
"message": f"Cannot find composio action with name `{composio_action_name}`.",
"composio_action_name": composio_action_name,
},
@@ -251,6 +252,7 @@ def add_composio_tool(
raise HTTPException(
status_code=400, # Bad Request
detail={
+ "code": "ComposioSDKError",
"message": f"No connected account found for tool `{composio_action_name}`. You need to connect the relevant app in Composio order to use the tool.",
"composio_action_name": composio_action_name,
},