-
Notifications
You must be signed in to change notification settings - Fork 11.1k
fix: map Responses reasoning stream to chat completion deltas #2837
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
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 | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -346,9 +346,10 @@ func ChatCompletionsRequestToResponsesRequest(req *dto.GeneralOpenAIRequest) (*d | |||||||||||||||||||||||||
| Metadata: req.Metadata, | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| if req.ReasoningEffort != "" && req.ReasoningEffort != "none" { | ||||||||||||||||||||||||||
| if req.ReasoningEffort != "" { | ||||||||||||||||||||||||||
| out.Reasoning = &dto.Reasoning{ | ||||||||||||||||||||||||||
| Effort: req.ReasoningEffort, | ||||||||||||||||||||||||||
| Effort: req.ReasoningEffort, | ||||||||||||||||||||||||||
| Summary: "detailed", | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
Comment on lines
+349
to
353
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. 🧩 Analysis chain🌐 Web query:
💡 Result:
|
||||||||||||||||||||||||||
| if req.ReasoningEffort != "" { | |
| out.Reasoning = &dto.Reasoning{ | |
| Effort: req.ReasoningEffort, | |
| Effort: req.ReasoningEffort, | |
| Summary: "detailed", | |
| } | |
| if req.ReasoningEffort != "" && strings.ToLower(req.ReasoningEffort) != "none" { | |
| out.Reasoning = &dto.Reasoning{ | |
| Effort: req.ReasoningEffort, | |
| Summary: "detailed", | |
| } | |
| } |
🤖 Prompt for AI Agents
In `@service/openaicompat/chat_to_responses.go` around lines 349 - 353, The
current block in chat_to_responses.go sets out.Reasoning =
&dto.Reasoning{Effort: req.ReasoningEffort, Summary: "detailed"} whenever
req.ReasoningEffort != "", which incorrectly requests a summary even when effort
== "none"; change the guard so you only set Summary (or create out.Reasoning
with Summary) when req.ReasoningEffort is non-empty and not equal to "none"
(e.g., check req.ReasoningEffort != "" && req.ReasoningEffort != "none"),
ensuring dto.Reasoning.Summary is omitted when effort disables reasoning.
Uh oh!
There was an error while loading. Please reload this page.