MaxKB icon indicating copy to clipboard operation
MaxKB copied to clipboard

[Bug] Using non-streaming parameters when using MCP will return an error

Open HunterWangwei opened this issue 1 month ago • 1 comments

Contact Information

[email protected]

MaxKB Version

v2.3.1 (build at 2025-11-12T18:45, commit: c78e0f1)

Problem Description

stream: false 且启用 MCP 时会返回报错 { "code": 500, "message": "成功", "data": { "chat_id": "019a83f6-97fb-7350-be6f-66df013c8c39", "id": "019a83f9-be30-7d70-96cc-949d64730b16", "operate": true, "content": "Exception:'generator' object has no attribute 'content'", "is_end": true, "completion_tokens": 0, "prompt_tokens": 0 } }

stream: true 时可以正常返回

Steps to Reproduce

{ "message": "你", "stream":false, "re_chat": true }

The expected correct result

No response

Related log output


Additional Information

No response

HunterWangwei avatar Nov 14 '25 20:11 HunterWangwei

您好,您应该是通过应用的对话接口访问应用的,我们做了测试,这个接口在stream=false时,返回正常,您的问题没有复现,请您再查证确认一下。

Image

Shenguobin0102 avatar Nov 17 '25 03:11 Shenguobin0102

我也遇到同样的问题,我是添加工具,在工具商品中添加MySQL查询工具 我这边是docker部署,[registry.fit2cloud.com/maxkb/maxkb]REPOSITORY TAG IMAGE ID CREATED SIZE registry.fit2cloud.com/maxkb/maxkb latest 5b3adb249ff2 2 weeks ago 2.78GB 本地调试

在应用-设置-调试预览,能够使用 在API 文档: http://localhost:8080/chat/api-doc/ 中调用失败 在终端调用失败

curl -X 'POST'
'http://localhost:8080/chat/api/chat_message/019ad8cc-156c-71b3-996d-0dd1cca2ee7e'
-H 'accept: /'
-H 'Authorization: Bearer application-767526f096ada7b99d6d00f0ee5c2019'
-H 'Content-Type: application/json'
-H 'X-CSRFTOKEN: xqVkZKRFIBjYkKOBEnBvn1hiiJcezFqNq98futZK5XmmmjUM2Ma0tJ8NccczTcSg'
-d '{ "message": "怎么参加活动", "stream": false, "re_chat": true, "chat_record_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" }'

返回结果: { "code": 500, "message": "成功", "data": { "chat_id": "019ad8cc-156c-71b3-996d-0dd1cca2ee7e", "id": "019ad8d6-adf1-7d52-ba93-02c0b2c65d95", "operate": true, "content": "Exception:'generator' object has no attribute 'content'", "is_end": true, "completion_tokens": 0, "prompt_tokens": 0 } }

bingsogood avatar Dec 01 '25 08:12 bingsogood