From 2be14d57bf66f7fe39d288b8c8906ed0e806f0e1 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 11 Jun 2024 14:30:18 -0700 Subject: [PATCH] fix --- backend/apps/webui/models/tools.py | 3 ++- backend/apps/webui/routers/tools.py | 3 ++- backend/utils/tools.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/apps/webui/models/tools.py b/backend/apps/webui/models/tools.py index 99463878b..e2db1e35f 100644 --- a/backend/apps/webui/models/tools.py +++ b/backend/apps/webui/models/tools.py @@ -92,7 +92,8 @@ class ToolsTable: return tool else: return None - except: + except Exception as e: + print(f"Error creating tool: {e}") return None def get_tool_by_id(self, id: str) -> Optional[ToolModel]: diff --git a/backend/apps/webui/routers/tools.py b/backend/apps/webui/routers/tools.py index f00e5d8b3..8026493e3 100644 --- a/backend/apps/webui/routers/tools.py +++ b/backend/apps/webui/routers/tools.py @@ -84,9 +84,10 @@ async def create_new_toolkit( else: raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, - detail=ERROR_MESSAGES.FILE_EXISTS, + detail=ERROR_MESSAGES.DEFAULT("Error creating toolkit"), ) except Exception as e: + print(e) raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, detail=ERROR_MESSAGES.DEFAULT(e), diff --git a/backend/utils/tools.py b/backend/utils/tools.py index 85f0a5701..5fef2a2b6 100644 --- a/backend/utils/tools.py +++ b/backend/utils/tools.py @@ -42,7 +42,7 @@ def get_tools_specs(tools) -> List[dict]: **( { "enum": ( - param_annotation.__args__ + str(param_annotation.__args__) if hasattr(param_annotation, "__args__") else None )