-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Missing Handling for delta.reasoning_content
in agents.models.chatcmpl_stream_handler.ChatCmplStreamHandler.handle_stream
#578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@kingmming which model produces delta.reasoning_content? |
Hi @rm-openai ! The When the Here is an example of how it appears in the response data: {
"choices": [
{
"delta": {
"content": null,
"reasoning_content": " smoothly"
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"object": "chat.completion.chunk",
"usage": null,
"created": 1745454612,
"system_fingerprint": null,
"model": "DeepSeek-R1",
"id": "chatcmpl-281b5461-bfa3-99f5-b3cb-650b2306e712"
}
{
"choices": [
{
"delta": {
"content": " assistant",
"reasoning_content": null
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"object": "chat.completion.chunk",
"usage": null,
"created": 1745454612,
"system_fingerprint": null,
"model": "DeepSeek-R1",
"id": "chatcmpl-281b5461-bfa3-99f5-b3cb-650b2306e712"
} |
I'm working on this issue, see this PR #494 |
`
here is also the missing part of reasoning_content |
Issue Title: Missing Handling for
delta.reasoning_content
inagents.models.chatcmpl_stream_handler.ChatCmplStreamHandler.handle_stream
Description:
In the
ChatCmplStreamHandler.handle_stream
method, the case wheredelta.reasoning_content
is present is not handled. This could lead to incomplete or incorrect handling of the stream response when reasoning content is provided by the model.Problematic Code Example:
Steps to Reproduce:
delta.reasoning_content
.ChatCmplStreamHandler.handle_stream
method does not process or emit events related to the reasoning content.Actual Behavior:
The
delta.reasoning_content
is ignored, and no events are emitted to handle or notify consumers of the reasoning content.Impact:
This issue prevents the proper handling and display of reasoning content in the stream, which is crucial for models that provide explanations or reasoning behind their responses.
Proposed Solution:
Add handling for
delta.reasoning_content
in theChatCmplStreamHandler.handle_stream
method. Example code snippet:The text was updated successfully, but these errors were encountered: