-
Notifications
You must be signed in to change notification settings - Fork 728
fix: The content field returns None #4689
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,7 +284,12 @@ impl From<DeltaChoice> for dynamo_async_openai::types::ChatChoice { | |
| message: dynamo_async_openai::types::ChatCompletionResponseMessage { | ||
| role: delta.role.expect("delta should have a Role"), | ||
| content: if delta.text.is_empty() { | ||
| None | ||
| // If we have reasoning content, provide an empty string instead of None. | ||
| if delta.reasoning_content.is_some() { | ||
| Some(String::new()) | ||
| } else { | ||
| None | ||
| } | ||
|
Comment on lines
286
to
+292
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add test coverage for the empty content with reasoning_content scenario. The code change at lines 286-292 intentionally returns 🤖 Prompt for AI Agents
Comment on lines
+288
to
+292
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this fix does not make sense to me. |
||
| } else { | ||
| Some(delta.text) | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?