-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add support for reasoning_content field in chat completion messages for DeepSeek R1 #925
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #925 +/- ##
==========================================
+ Coverage 98.46% 98.87% +0.41%
==========================================
Files 24 27 +3
Lines 1364 1783 +419
==========================================
+ Hits 1343 1763 +420
+ Misses 15 14 -1
Partials 6 6 ☔ View full report in Codecov by Sentry. |
@goodenough227 could you please point to the OpenAI API reference for this one? Or is this field only supported by DeepSeek currently? |
I also have a need for this feature. |
sorry for this wrong description generated by AI code hepler. "reasoning_content" field is only supported by deepseek R1 currently. |
Originally, this repository was targeted on the official OpenAI API. But, in the context of the official client popping up — I'm willing to merge this My only ask here is: can we please clearly indicate that this field is not supported by OpenAI? Ideally, it should be obvious from the variable name and from reading the docs. Thank you! |
Get it. I have written a comment on this field. |
# Conflicts: # chat.go # openai_test.go
@sashabaranov I have added comments in a similar way as in the previous code, please review |
Hope to merge and support this as soon as possible. Thank you for your contribution! @sashabaranov @goodenough227 |
please review&approved, thank you @sashabaranov @goodenough227 |
mark |
feat: Add support for reasoning_content field in chat completion messages
This PR adds support for the
reasoning_content
field in the ChatCompletionMessage struct to accommodate models that return their reasoning process separately from the main content. This feature is particularly useful for:Both models return their step-by-step reasoning process through this field.
Changes:
reasoning_content
field to ChatCompletionMessage structExample response structure: