Fix incorrect formatting in OpenAI responses API for tool#125
Fix incorrect formatting in OpenAI responses API for tool#125mattt merged 3 commits intomattt:mainfrom
Conversation
6be4c92 to
457c634
Compare
There was a problem hiding this comment.
Pull request overview
Fixes incorrect OpenAI Responses API request-body formatting for tool-call round trips in OpenAILanguageModel (Fix #124), aligning it with Responses API conventions rather than Chat Completions conventions.
Changes:
- Formats
function_call_output.outputas a direct value (plain string for.text, JSON array for.blocks) instead of JSON-stringifying “content blocks”. - Flattens
image_urlin tool output blocks to a string URL (Responses format). - Converts Chat Completions-style raw assistant
tool_callsmessages into Responsesfunction_callinput items.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@noorbhatia Thanks for your work on this. This isn't the first regression we've had with OpenAI request formatting, so I spent some time attempting to contrive a failing test case. Problem is, the API appears to be too flexible in what it expects (or else, I'm not clever enough to find a counter-example). I added what I came up with in c7ee6be. Until we fold in Replay and test the exact shape of request objects, this will have to do, I suppose. |
|
This is now available in 0.7.1 |
Fix #124