diff --git a/backend/apps/webui/routers/tools.py b/backend/apps/webui/routers/tools.py index 92f9ab0a8..67e391ddd 100644 --- a/backend/apps/webui/routers/tools.py +++ b/backend/apps/webui/routers/tools.py @@ -80,6 +80,8 @@ async def create_new_toolkit(form_data: ToolForm, user=Depends(get_admin_user)): detail="Only alphanumeric characters and underscores are allowed in the id", ) + form_data.id = form_data.id.lower() + toolkit = Tools.get_tool_by_id(form_data.id) if toolkit == None: toolkit_path = os.path.join(TOOLS_DIR, f"{form_data.id}.py") @@ -151,7 +153,7 @@ async def update_toolkit_by_id( specs = get_tools_specs(TOOLS[id]) updated = { - **form_data.model_dump(), + **form_data.model_dump(exclude={"id"}), "specs": specs, } diff --git a/src/lib/components/workspace/Tools.svelte b/src/lib/components/workspace/Tools.svelte index d5650c68d..959dc17cb 100644 --- a/src/lib/components/workspace/Tools.svelte +++ b/src/lib/components/workspace/Tools.svelte @@ -8,7 +8,13 @@ import { createNewPrompt, deletePromptByCommand, getPrompts } from '$lib/apis/prompts'; import { goto } from '$app/navigation'; - import { createNewTool, deleteToolById, exportTools, getTools } from '$lib/apis/tools'; + import { + createNewTool, + deleteToolById, + exportTools, + getToolById, + getTools + } from '$lib/apis/tools'; const i18n = getContext('i18n'); @@ -121,9 +127,20 @@