diff --git a/web/app/components/app/configuration/config/agent/agent-tools/index.tsx b/web/app/components/app/configuration/config/agent/agent-tools/index.tsx index 95858d9540..b92ff94983 100644 --- a/web/app/components/app/configuration/config/agent/agent-tools/index.tsx +++ b/web/app/components/app/configuration/config/agent/agent-tools/index.tsx @@ -210,6 +210,7 @@ const AgentTools: FC = () => { setting={currentTool?.tool_parameters as any} collection={currentTool?.collection as Collection} isBuiltIn={currentTool?.collection?.type === CollectionType.builtIn} + isModel={currentTool?.collection?.type === CollectionType.model} onSave={handleToolSettingChange} onHide={() => setIsShowSettingTool(false)} />) diff --git a/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx b/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx index 378054aae6..9eb2657fcf 100644 --- a/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx +++ b/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx @@ -58,11 +58,16 @@ const SettingBuiltInTool: FC = ({ (async () => { setIsLoading(true) try { - const list = isBuiltIn - ? await fetchBuiltInToolList(collection.name) - : isModel - ? await fetchModelToolList(collection.name) - : await fetchCustomToolList(collection.name) + const list = await new Promise((resolve) => { + (async function () { + if (isModel) + resolve(await fetchModelToolList(collection.name)) + else if (isBuiltIn) + resolve(await fetchBuiltInToolList(collection.name)) + else + resolve(await fetchCustomToolList(collection.name)) + }()) + }) setTools(list) const currTool = list.find(tool => tool.name === toolName) if (currTool) {