fix: tool call

This commit is contained in:
archer 2025-06-03 11:04:17 +08:00
parent 2b888fb0fa
commit 361e255af8
No known key found for this signature in database
GPG Key ID: 4446499B846D4A9E
4 changed files with 615 additions and 680 deletions

View File

@ -1,7 +1,7 @@
{
"author": "",
"name": "博查搜索",
"avatar": "core/workflow/template/bocha",
"name": "网络搜索",
"avatar": "common/searchLight",
"intro": "使用博查AI搜索引擎进行网络搜索。",
"showStatus": true,
"weight": 10,
@ -24,9 +24,7 @@
"version": "481",
"inputs": [
{
"renderTypeList": [
"input"
],
"renderTypeList": ["input"],
"selectedTypeIndex": 0,
"valueType": "string",
"canEdit": true,
@ -37,10 +35,7 @@
"required": true
},
{
"renderTypeList": [
"input",
"reference"
],
"renderTypeList": ["input", "reference"],
"selectedTypeIndex": 0,
"valueType": "string",
"canEdit": true,
@ -52,10 +47,7 @@
"toolDescription": "搜索查询词"
},
{
"renderTypeList": [
"input",
"reference"
],
"renderTypeList": ["input", "reference"],
"selectedTypeIndex": 0,
"valueType": "string",
"canEdit": true,
@ -67,10 +59,7 @@
"toolDescription": "搜索时间范围"
},
{
"renderTypeList": [
"input",
"reference"
],
"renderTypeList": ["input", "reference"],
"selectedTypeIndex": 0,
"valueType": "boolean",
"canEdit": true,
@ -82,10 +71,7 @@
"toolDescription": "是否显示文本摘要"
},
{
"renderTypeList": [
"input",
"reference"
],
"renderTypeList": ["input", "reference"],
"selectedTypeIndex": 0,
"valueType": "string",
"canEdit": true,
@ -97,10 +83,7 @@
"toolDescription": "指定搜索的site范围"
},
{
"renderTypeList": [
"input",
"reference"
],
"renderTypeList": ["input", "reference"],
"selectedTypeIndex": 0,
"valueType": "string",
"canEdit": true,
@ -112,10 +95,7 @@
"toolDescription": "排除搜索的网站范围"
},
{
"renderTypeList": [
"input",
"reference"
],
"renderTypeList": ["input", "reference"],
"selectedTypeIndex": 0,
"valueType": "number",
"canEdit": true,
@ -195,19 +175,14 @@
"version": "481",
"inputs": [
{
"renderTypeList": [
"reference"
],
"renderTypeList": ["reference"],
"valueType": "object",
"canEdit": true,
"key": "result",
"label": "result",
"isToolOutput": true,
"description": "",
"value": [
"nyA6oA8mF1iW",
"httpRawResponse"
]
"value": ["nyA6oA8mF1iW", "httpRawResponse"]
}
],
"outputs": []
@ -241,9 +216,7 @@
"inputs": [
{
"key": "system_addInputParam",
"renderTypeList": [
"addInputParam"
],
"renderTypeList": ["addInputParam"],
"valueType": "dynamic",
"label": "",
"required": false,
@ -274,9 +247,7 @@
},
{
"key": "system_httpMethod",
"renderTypeList": [
"custom"
],
"renderTypeList": ["custom"],
"valueType": "string",
"label": "",
"value": "POST",
@ -286,9 +257,7 @@
},
{
"key": "system_httpTimeout",
"renderTypeList": [
"custom"
],
"renderTypeList": ["custom"],
"valueType": "number",
"label": "",
"value": 30,
@ -300,9 +269,7 @@
},
{
"key": "system_httpReqUrl",
"renderTypeList": [
"hidden"
],
"renderTypeList": ["hidden"],
"valueType": "string",
"label": "",
"description": "common:core.module.input.description.Http Request Url",
@ -314,9 +281,7 @@
},
{
"key": "system_httpHeader",
"renderTypeList": [
"custom"
],
"renderTypeList": ["custom"],
"valueType": "any",
"value": [
{
@ -339,9 +304,7 @@
},
{
"key": "system_httpParams",
"renderTypeList": [
"hidden"
],
"renderTypeList": ["hidden"],
"valueType": "any",
"value": [],
"label": "",
@ -351,9 +314,7 @@
},
{
"key": "system_httpJsonBody",
"renderTypeList": [
"hidden"
],
"renderTypeList": ["hidden"],
"valueType": "any",
"value": "{\n \"query\": \"{{query}}\",\n \"freshness\": \"{{freshness}}\",\n \"summary\": {{summary}},\n \"include\": \"{{include}}\",\n \"exclude\": \"{{exclude}}\",\n \"count\": {{count}}\n}",
"label": "",
@ -363,9 +324,7 @@
},
{
"key": "system_httpFormBody",
"renderTypeList": [
"hidden"
],
"renderTypeList": ["hidden"],
"valueType": "any",
"value": [],
"label": "",
@ -375,9 +334,7 @@
},
{
"key": "system_httpContentType",
"renderTypeList": [
"hidden"
],
"renderTypeList": ["hidden"],
"valueType": "string",
"value": "json",
"label": "",
@ -387,9 +344,7 @@
},
{
"valueType": "string",
"renderTypeList": [
"reference"
],
"renderTypeList": ["reference"],
"key": "query",
"label": "query",
"toolDescription": "博查搜索检索词",
@ -420,16 +375,11 @@
"showDescription": false,
"showDefaultValue": true
},
"value": [
"pluginInput",
"query"
]
"value": ["pluginInput", "query"]
},
{
"valueType": "string",
"renderTypeList": [
"reference"
],
"renderTypeList": ["reference"],
"key": "freshness",
"label": "freshness",
"toolDescription": "搜索时间范围",
@ -460,16 +410,11 @@
"showDescription": false,
"showDefaultValue": true
},
"value": [
"pluginInput",
"freshness"
]
"value": ["pluginInput", "freshness"]
},
{
"valueType": "boolean",
"renderTypeList": [
"reference"
],
"renderTypeList": ["reference"],
"key": "summary",
"label": "summary",
"toolDescription": "是否显示文本摘要",
@ -500,16 +445,11 @@
"showDescription": false,
"showDefaultValue": true
},
"value": [
"pluginInput",
"summary"
]
"value": ["pluginInput", "summary"]
},
{
"valueType": "string",
"renderTypeList": [
"reference"
],
"renderTypeList": ["reference"],
"key": "include",
"label": "include",
"toolDescription": "指定搜索的site范围",
@ -540,16 +480,11 @@
"showDescription": false,
"showDefaultValue": true
},
"value": [
"pluginInput",
"include"
]
"value": ["pluginInput", "include"]
},
{
"valueType": "string",
"renderTypeList": [
"reference"
],
"renderTypeList": ["reference"],
"key": "exclude",
"label": "exclude",
"toolDescription": "排除搜索的网站范围",
@ -580,16 +515,11 @@
"showDescription": false,
"showDefaultValue": true
},
"value": [
"pluginInput",
"exclude"
]
"value": ["pluginInput", "exclude"]
},
{
"valueType": "number",
"renderTypeList": [
"reference"
],
"renderTypeList": ["reference"],
"key": "count",
"label": "count",
"toolDescription": "返回结果条数",
@ -620,10 +550,7 @@
"showDescription": false,
"showDefaultValue": true
},
"value": [
"pluginInput",
"count"
]
"value": ["pluginInput", "count"]
}
],
"outputs": [

View File

@ -10,9 +10,6 @@ import { useChatStore } from '@/web/core/chat/context/useChatStore';
import MyBox from '@fastgpt/web/components/common/MyBox';
import { cardStyles } from '../constants';
import ChatQuoteList from '@/pageComponents/chat/ChatQuoteList';
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
import { getQuickApps, listQuickApps } from '@/web/support/user/team/gate/quickApp';
import Avatar from '@fastgpt/web/components/common/Avatar';
type Props = {
appForm: AppSimpleEditFormType;

View File

@ -47,7 +47,6 @@ const GateToolSelect = ({
const { data: gateConfig, loading: loadingGateConfig } = useRequest2(() => getTeamGateConfig(), {
manual: false
});
console.log('gateConfig', gateConfig);
// 获取系统插件模板
const { data: systemPlugins = [], loading: loadingSystemPlugins } = useRequest2(

View File

@ -31,6 +31,18 @@ export const useChatGate = ({
const { userInfo } = useUserStore();
const { setChatId, chatId, appId } = useChatStore();
const [selectedTools, setSelectedTools] = useState<FlowNodeTemplateType[]>([]);
const onSelectTools = useCallback(
(tools: FlowNodeTemplateType[]) => {
tools.forEach((tool) => {
const formTool = appForm.selectedTools.find((t) => t.pluginId === tool.pluginId);
if (formTool) {
tool.inputs = formTool.inputs;
}
});
setSelectedTools(tools);
},
[appForm]
);
const [workflowData, setWorkflowData] = useSafeState({
nodes: appDetail.modules || [],
@ -153,7 +165,7 @@ export const useChatGate = ({
const { data: recommendApps = [] } = useRequest2(listQuickApps, {
manual: false
});
console.log(appForm, 111);
const CustomChatContainer = useMemoizedFn(() => (
<ChatBox
isReady={isReady}
@ -163,7 +175,7 @@ export const useChatGate = ({
chatType={'chat'}
onStartChat={startChat}
selectedTools={selectedTools}
onSelectTools={setSelectedTools}
onSelectTools={onSelectTools}
recommendApps={recommendApps}
/>
));