ChatLunaLab / chatluna

多平台模型接入,可扩展,多种输出格式,提供大语言模型聊天服务的机器人插件
https://chatluna.chat
GNU Affero General Public License v3.0
135 stars 19 forks source link

组合使用openai-adapter和search-service,出现报错 #197

Closed Azerz closed 4 weeks ago

Azerz commented 1 month ago

模板房间选项选择“插件模式” 2024-07-19 15:16:04 [E] chatluna ====================ChatLunaError:1==================== 2024-07-19 15:16:04 [E] chatluna Error: 400 Bad Request {"error":{"message":"Invalid value for 'content': expected a string, got null.","type":"invalid_request_error","param":"messages.[3].content","code":null}} at checkResponse (/home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna/lib/utils/sse.cjs:136:7) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async rawSeeAsIterable (/home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna/lib/utils/sse.cjs:169:3) at async sseIterable (/home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna/lib/utils/sse.cjs:189:20) at async OpenAIRequester.completionStream (/home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna-openai-adapter/lib/index.cjs:231:24) at async ChatLunaChatModel._streamResponseChunks (/home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna/lib/llm-core/platform/model.cjs:155:22) at async ChatLunaChatModel._streamIterator (/home/wolfe/.koishi/data/instances/default/node_modules/@langchain/core/dist/language_models/chat_models.cjs:93:34) at async ChatLunaChatModel.transform (/home/wolfe/.koishi/data/instances/default/node_modules/@langchain/core/dist/runnables/base.cjs:394:9) at async RunnableBinding.transform (/home/wolfe/.koishi/data/instances/default/node_modules/@langchain/core/dist/runnables/base.cjs:840:9) at async wrapInputForTracing (/home/wolfe/.koishi/data/instances/default/node_modules/@langchain/core/dist/runnables/base.cjs:267:30)

选择“Browsing模式” chatluna Error: Unknown proxy mode: undefined at ChatLunaPlugin.fetch (/home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna/lib/services/chat.cjs:1042:15) at SerperSearchTool._call (/home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna-search-service/lib/index.cjs:645:36) at SerperSearchTool.call (/home/wolfe/.koishi/data/instances/default/node_modules/@langchain/core/dist/tools/index.cjs:96:33) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async _ChatLunaBrowsingChain.call (/home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna-search-service/lib/index.cjs:342:7) at async ChatInterfaceWrapper.chat (/home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna/lib/services/chat.cjs:1089:27) at async ChainMiddleware.execute (/home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna/lib/index.cjs:4692:25) at async ChatChain._runMiddleware (/home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna/lib/services/chat.cjs:187:18) at async ChatChain.receiveMessage (/home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna/lib/services/chat.cjs:130:20) at async /home/wolfe/.koishi/data/instances/default/node_modules/koishi-plugin-chatluna/lib/index.cjs:5897:15

search-service 配置的Serper,gpt 正常对话可以使用

Azerz commented 1 month ago

openai使用的chatanywhere,可能问题出在这。我排查一下啊

dingyi222666 commented 1 month ago

我看看怎么修

Azerz commented 1 month ago

我看看怎么修

今天更新后langchain可以用了,browsing没效果也没报错。

还有个小bug,用longchain模式同时打开用户权限限制的时候会把提问者chathub_auth_user表中balance配置为Null

dingyi222666 commented 4 weeks ago

理论上已经修复,包括插件模式的 balance 问题。我这边先关闭 issue 了,有新问题在开一个新的 issue 吧