Skip to content

[Bug] Exception:'generator' object has no attribute 'content' #6300

Description

@ethan-changyz

Contact Information

ly_cyz@163.com

MaxKB Version

v2.10.2-lts

Problem Description

I define any tool in the tool, such as
tool:

def test_calc(a: int, b: int): res = a + b return { "success": True, "content": f"Calculation result: {a} + {b} = {res}" }

As long as the intelligent agent is associated, the following error is reported?
Exception:'generator' object has no attribute 'content'

Steps to Reproduce

curl http://192.168.1.1:8899/chat/api/019f128b-087b-7262-8413-e360bf021dde/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer agent-3a44550e80693cc309820138f5a4e78"
-d '{
"model": "deepseek-v4-pro",
"messages": [
{
"role": "旅游规划助手",
"content": "MaxKB 是什么?"
}
]
}'

The expected correct result

No response

Related log output

{"id": "019f12d9-4dbb-7973-99fe-a76ec1fa7d2c", "choices": [{"finish_reason": "stop", "index": 0, "logprobs": null, "message": {"content": "Exception:'generator' object has no attribute 'content'", "refusal": null, "role": "assistant", "annotations": null, "audio": null, "function_call": null, "tool_calls": null}, "chat_id": "5bd05933-73a2-11f1-b05d-0240a8c04202", "answer_list": ""}], "created": 39, "model": "", "object": "chat.completion", "moderation": null, "service_tier": null, "system_fingerprint": null, "usage": {"completion_tokens": 0, "prompt_tokens": 0, "total_tokens": 0, "completion_tokens_details": null, "prompt_tokens_details": null}}%    

Additional Information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions