fix: handle Responses API text.format parameter correctly#5557
fix: handle Responses API text.format parameter correctly#5557replicas-connector[bot] wants to merge 1 commit into
Conversation
The Responses API uses text.format for structured output configuration, not response_format (which is used in Chat Completions API). This fix: - Removes response_format from ResponsesRequestBody and OpenAIResponseRequest - Adds proper text.format type with json_schema support - Updates toChatCompletions to convert text.format to response_format - Adds tests for json_schema, json_object, and text format types Fixes the error: "Unsupported parameter: 'response_format'. In the Responses API, this parameter has moved to 'text.format'." Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Claude finished @replicas-connector[bot]'s task —— View job PR Review CompleteI've analyzed the code changes for the Responses API Score: 9/10 - Excellent fix with proper implementationThis is a well-executed fix that correctly addresses the API difference between OpenAI's Chat Completions and Responses APIs. The implementation is solid with comprehensive test coverage. Suggestions Summary:✅ Strengths:
🔍 Code Quality Analysis:
🚀 Minor Suggestions for Improvement:
🔒 Security Assessment:
📋 Performance:
Verification Notes:
This is a high-quality fix that properly resolves the |
Summary
text.formatparameter handling bugUnsupported parameter: 'response_format'. In the Responses API, this parameter has moved to 'text.format'.Root Cause
response_format: { type: 'json_schema', json_schema: {...} }text: { format: { type: 'json_schema', json_schema: {...} } }Helicone's mapper incorrectly defined
response_formatin the Responses API types and didn't converttext.formatproperly.Changes
packages/llm-mapper/transform/types/responses.ts
response_formatfromResponsesRequestBody(invalid for Responses API)ResponsesTextFormatinterface with proper type definitiontextfield to includeformatwith json_schema supportpackages/llm-mapper/transform/providers/responses/request/toChatCompletions.ts
text.formatinstead ofresponse_formatpackages/llm-mapper/mappers/openai/responses.ts
OpenAIResponseRequestinterface to usetext.formatinstead ofresponse_formatpackages/tests/llm-mapper/openai-chat-to-responses-converters.test.ts
Test plan
🤖 Generated with Claude Code