Closed mwnu closed 3 months ago
😂没遇到过,遇到再看
😂没遇到过,遇到再看
我想已经弄清楚了,是工具调用模块的问题,工具调用插件如果使用不支持函数调用的模型(如claude)就会出现错误,而如果使用支持函数调用但没有没有获取预期的结果,虽然不会报错,但也会重试,只我并没有在该应用中对话,不知道为什么它会每小时重试一次。
应用配置:
{
"nodes": [
{
"nodeId": "userGuide",
"name": "系统配置",
"intro": "可以配置应用的系统参数",
"avatar": "/imgs/workflow/userGuide.png",
"flowNodeType": "userGuide",
"position": {
"x": 531.2422736065552,
"y": -486.7611729549753
},
"version": "481",
"inputs": [],
"outputs": []
},
{
"nodeId": "workflowStartNodeId",
"name": "流程开始",
"intro": "",
"avatar": "/imgs/workflow/userChatInput.svg",
"flowNodeType": "workflowStart",
"position": {
"x": 558.4082376415505,
"y": 123.72387429194112
},
"version": "481",
"inputs": [
{
"key": "userChatInput",
"renderTypeList": [
"reference",
"textarea"
],
"valueType": "string",
"label": "用户问题",
"required": true,
"toolDescription": "用户问题"
}
],
"outputs": [
{
"id": "userChatInput",
"key": "userChatInput",
"label": "core.module.input.label.user question",
"valueType": "string",
"type": "static"
}
]
},
{
"nodeId": "cHiFqx",
"name": "工具调用(实验)",
"intro": "通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。",
"avatar": "/imgs/workflow/tool.svg",
"flowNodeType": "tools",
"showStatus": true,
"position": {
"x": 1062.1738942532802,
"y": -223.65033022650476
},
"version": "481",
"inputs": [
{
"key": "model",
"renderTypeList": [
"settingLLMModel",
"reference"
],
"label": "core.module.input.label.aiModel",
"valueType": "string",
"llmModelType": "all",
"value": "gpt-3.5-turbo"
},
{
"key": "temperature",
"renderTypeList": [
"hidden"
],
"label": "",
"value": 2,
"valueType": "number",
"min": 0,
"max": 10,
"step": 1
},
{
"key": "maxToken",
"renderTypeList": [
"hidden"
],
"label": "",
"value": 4096,
"valueType": "number",
"min": 100,
"max": 4000,
"step": 50
},
{
"key": "systemPrompt",
"renderTypeList": [
"textarea",
"reference"
],
"max": 3000,
"valueType": "string",
"label": "core.ai.Prompt",
"description": "core.app.tip.chatNodeSystemPromptTip",
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
"value": "用用户的语言总结"
},
{
"key": "history",
"renderTypeList": [
"numberInput",
"reference"
],
"valueType": "chatHistory",
"label": "core.module.input.label.chat history",
"description": "最多携带多少轮对话记录",
"required": true,
"min": 0,
"max": 30,
"value": 6
},
{
"key": "userChatInput",
"renderTypeList": [
"reference",
"textarea"
],
"valueType": "string",
"label": "用户问题",
"required": true,
"value": [
"workflowStartNodeId",
"userChatInput"
]
}
],
"outputs": []
},
{
"nodeId": "huoAI4",
"name": "简单搜索",
"intro": "简单搜索",
"avatar": "/icon/logo.svg",
"flowNodeType": "pluginModule",
"showStatus": true,
"position": {
"x": 1000,
"y": 545
},
"version": "481",
"inputs": [
{
"key": "query",
"valueType": "string",
"label": "query",
"renderTypeList": [
"reference"
],
"required": false,
"description": "搜索查询字符串",
"toolDescription": "搜索查询字符串",
"canEdit": false,
"editField": {
"key": true,
"name": true,
"description": true,
"required": true,
"dataType": true,
"inputType": true,
"isToolInput": true
},
"value": ""
}
],
"outputs": [
{
"id": "images",
"type": "static",
"key": "images",
"valueType": "datasetQuote",
"label": "images",
"description": ""
},
{
"id": "results",
"type": "static",
"key": "results",
"valueType": "datasetQuote",
"label": "results",
"description": ""
}
],
"pluginId": "662cd19ccf4394583d321fa5"
}
],
"edges": [
{
"source": "workflowStartNodeId",
"target": "cHiFqx",
"sourceHandle": "workflowStartNodeId-source-right",
"targetHandle": "cHiFqx-target-left"
},
{
"source": "cHiFqx",
"target": "huoAI4",
"sourceHandle": "selectedTools",
"targetHandle": "selectedTools"
}
],
"chatConfig": {
"welcomeText": "",
"variables": [],
"questionGuide": false,
"ttsConfig": {
"type": "web"
},
"whisperConfig": {
"open": false,
"autoSend": false,
"autoTTSResponse": false
},
"scheduledTriggerConfig": {
"cronString": "",
"timezone": "Asia/Shanghai",
"defaultPrompt": ""
},
"chatInputGuide": {
"open": false,
"textList": [],
"customUrl": ""
},
"_id": "665f5ce9f66a44eb9c606172"
}
}
插件配置:
{
"nodes": [
{
"nodeId": "OIoX7OM2gXfj",
"name": "定义插件输入",
"intro": "自定义配置外部输入,使用插件时,仅暴露自定义配置的输入",
"avatar": "/imgs/workflow/input.png",
"flowNodeType": "pluginInput",
"showStatus": false,
"position": {
"x": 557.484620014067,
"y": -168.21037859203835
},
"version": "481",
"inputs": [
{
"key": "query",
"valueType": "string",
"label": "query",
"renderTypeList": [
"reference"
],
"required": false,
"description": "搜索查询字符串",
"toolDescription": "搜索查询字符串",
"canEdit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"required": true,
"dataType": true,
"inputType": true,
"isToolInput": true
}
}
],
"outputs": [
{
"id": "dFDc3Sl53joi",
"key": "query",
"valueType": "string",
"label": "query",
"type": "source",
"edit": true
}
]
},
{
"nodeId": "dekvQjRbs128",
"name": "定义插件输出",
"intro": "自定义配置外部输出,使用插件时,仅暴露自定义配置的输出",
"avatar": "/imgs/workflow/output.png",
"flowNodeType": "pluginOutput",
"showStatus": false,
"position": {
"x": 1607.7142331269126,
"y": -151.8669210746189
},
"version": "481",
"inputs": [
{
"key": "images",
"valueType": "datasetQuote",
"label": "images",
"renderTypeList": [
"reference"
],
"required": false,
"description": "",
"canEdit": true,
"editField": {
"key": true,
"description": true,
"valueType": true
},
"value": [
"coz28JnSopQj",
"Vah2BqPABZcH"
]
},
{
"key": "results",
"valueType": "datasetQuote",
"label": "results",
"renderTypeList": [
"reference"
],
"required": false,
"description": "",
"canEdit": true,
"editField": {
"key": true,
"description": true,
"valueType": true
},
"value": [
"coz28JnSopQj",
"3LVZ1hu2w30f"
]
}
],
"outputs": []
},
{
"nodeId": "coz28JnSopQj",
"name": "HTTP 请求",
"intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
"avatar": "/imgs/workflow/http.png",
"flowNodeType": "httpRequest468",
"showStatus": true,
"position": {
"x": 1042.549746602742,
"y": -447.77496332641647
},
"version": "481",
"inputs": [
{
"key": "system_addInputParam",
"renderTypeList": [
"addInputParam"
],
"valueType": "dynamic",
"label": "",
"required": false,
"description": "core.module.input.description.HTTP Dynamic Input",
"editField": {
"key": true,
"valueType": true
}
},
{
"key": "query",
"valueType": "string",
"label": "query",
"renderTypeList": [
"reference"
],
"canEdit": true,
"editField": {
"key": true,
"valueType": true
},
"value": [
"OIoX7OM2gXfj",
"dFDc3Sl53joi"
]
},
{
"key": "system_httpMethod",
"renderTypeList": [
"custom"
],
"valueType": "string",
"label": "",
"value": "POST",
"required": true
},
{
"key": "system_httpReqUrl",
"renderTypeList": [
"hidden"
],
"valueType": "string",
"label": "",
"description": "core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory",
"required": false,
"value": "https://api.tavily.com/search"
},
{
"key": "system_httpHeader",
"renderTypeList": [
"custom"
],
"valueType": "any",
"value": [],
"label": "",
"description": "core.module.input.description.Http Request Header",
"placeholder": "core.module.input.description.Http Request Header",
"required": false
},
{
"key": "system_httpParams",
"renderTypeList": [
"hidden"
],
"valueType": "any",
"value": [],
"label": "",
"required": false
},
{
"key": "system_httpJsonBody",
"renderTypeList": [
"hidden"
],
"valueType": "any",
"value": "{\n \"api_key\": \"tvly-xxx\",\n \"query\": \"{{query}}\",\n \"search_depth\": \"basic\",\n \"include_images\": false,\n \"include_answer\": false,\n \"include_raw_content\": false,\n \"max_results\": 5,\n \"include_domains\": [],\n \"exclude_domains\": []\n}",
"label": "",
"required": false
}
],
"outputs": [
{
"id": "system_addOutputParam",
"key": "system_addOutputParam",
"type": "dynamic",
"valueType": "dynamic",
"label": "",
"editField": {
"key": true,
"valueType": true
}
},
{
"id": "httpRawResponse",
"key": "httpRawResponse",
"label": "原始响应",
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
"valueType": "any",
"type": "static",
"required": true
},
{
"id": "Vah2BqPABZcH",
"type": "dynamic",
"key": "images",
"valueType": "any",
"label": "images"
},
{
"id": "3LVZ1hu2w30f",
"type": "dynamic",
"key": "results",
"valueType": "any",
"label": "results"
}
]
}
],
"edges": [
{
"source": "OIoX7OM2gXfj",
"target": "coz28JnSopQj",
"sourceHandle": "OIoX7OM2gXfj-source-right",
"targetHandle": "coz28JnSopQj-target-left"
},
{
"source": "coz28JnSopQj",
"target": "dekvQjRbs128",
"sourceHandle": "coz28JnSopQj-source-right",
"targetHandle": "dekvQjRbs128-target-left"
}
]
}
工具调用终止模块不知道怎么用的
也许不是工具插件的问题,我删除了应用重新创建了一下应用,该定时空请求仍然出现,而且多个没有使用工具插件的也出现错误日志(空请求)。 日志里面是这样的:
[Info] 2024-06-16 14:00:00 Clear invalid dataset files, total files: 0
[Info] 2024-06-16 14:00:00 Clear invalid dataset files finish, remove 0 files
[Error] 2024-06-16 14:00:01 Schedule trigger error
{ message: 'core.chat.error.User input empty', stack: undefined }
.....
[Error] 2024-06-16 14:00:02 Schedule trigger error
{ message: 'Question is empty', stack: undefined }
[Error] 2024-06-16 14:00:18 Schedule trigger error
{ message: 'Question is empty', stack: undefined }
数据库翻翻 apps 表?看看有没有启用定时器的应用。
数据库翻翻 apps 表?看看有没有启用定时器的应用。
查了,有多个scheduledTriggerConfig和scheduledTriggerNextTime不为null的, cronString为空,但是却有预定触发时间?
"scheduledTriggerConfig": {
"cronString": "",
"timezone": "Asia/Shanghai",
"defaultPrompt": ""
},
"scheduledTriggerNextTime": ISODate("2024-06-16T16:01:00Z")
一旦设了定时任务,再给它关闭,scheduledTriggerConfig和scheduledTriggerNextTime这两个参数都不为null了(只是cronString变成空字符串),而定时任务是升级到v4.8.x自动启动的,我手动给它们关了。
数据库翻翻 apps 表?看看有没有启用定时器的应用。
一旦设了定时任务,再给它关闭,scheduledTriggerConfig和scheduledTriggerNextTime这两个参数都不为null了(只是cronString变成空字符串),而定时任务是升级到v4.8.x自动启动的,我手动给它们关了。
我在数据库中全部设为null之后看起来后面没有再定时发空请求了。
db.apps.updateMany(
{
$or: [
{ scheduledTriggerConfig: { $ne: null } },
{ scheduledTriggerNextTime: { $ne: null } },
{ "chatConfig.scheduledTriggerConfig": { $ne: null } }
]
},
{
$set: {
scheduledTriggerConfig: null,
scheduledTriggerNextTime: null,
"chatConfig.scheduledTriggerConfig": null
}
}
)
已pr
例行检查
你的版本
问题描述, 日志截图
首先是每小时都会向OpenAI 的API 发出两个调用gpt-3.5-turbo的请求,消耗的tokens都是固定的。
这个问题是fastgpt 有定时任务的版本后才出现的,我把所有的定时任务都取消了,这个整点定时的请求不知道从哪发出的。
其次也是同一时间,日志中出现错误,向API调用dall-e-3,我的应用中只有一个dall-e-3的应用,这个应用没有直接调用AI对话模块,而是用一个http插件来访问dall-e-3的API,但是没有定时任务。我怀疑上面定时的gpt-3.5-turbo请求也和它有关。
复现步骤
这个是应用的配置:
预期结果
相关截图