Repository navigation
fix(open-responses): map non-image file parts to input_file - #15212
Merged
Merged
Conversation
6 tasks done
aayush-kapoor
enabled auto-merge (squash)
May 12, 2026 18:23
lgrammel
approved these changes
May 13, 2026
Contributor
|
|
Contributor
|
🚀 Published in:
|
aayush-kapoor
added a commit
that referenced
this pull request
May 13, 2026
…#15259) This is an automated backport of #15212 to the release-v6.0 branch. FYI @aayush-kapoor This backport has conflicts that need to be resolved manually. ### `git cherry-pick` output ``` Auto-merging packages/open-responses/src/responses/convert-to-open-responses-input.test.ts Auto-merging packages/open-responses/src/responses/convert-to-open-responses-input.ts CONFLICT (content): Merge conflict in packages/open-responses/src/responses/convert-to-open-responses-input.ts Auto-merging packages/open-responses/src/responses/open-responses-language-model.test.ts error: could not apply 52d2e30... fix(open-responses): map non-image file parts to input_file (#15212) hint: After resolving the conflicts, mark them with hint: "git add/rm <pathspec>", then run hint: "git cherry-pick --continue". hint: You can instead skip this commit with "git cherry-pick --skip". hint: To abort and get back to the state before "git cherry-pick", hint: run "git cherry-pick --abort". hint: Disable this message with "git config set advice.mergeConflict false" ``` --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Aayush Kapoor <83492835+aayush-kapoor@users.noreply.github.com>
gr2m
pushed a commit
that referenced
this pull request
Jun 5, 2026
## Background #13843 file parts that are not images (e.g., application/pdf) are silently dropped from the request body. The SDK logs a warning (unsupported file content type), but the resulting API request is sent without the file data, often causing the model to respond that no document was provided. The OpenAI Responses API supports non-image files via the input_file part ## Summary adds support for non-image file inputs, especially PDFs, by mapping them to OpenAI Responses input_file parts: - URL-backed files become `{ type: 'input_file', file_url: '...' }` - base64/data-backed files become `{ type: 'input_file', filename, file_data: 'data:<mediaType>;base64,...' }` ## Manual Verification verified by running the cli examples ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues fixes #13843 Co-authored-by: shivamtiwari3 <33183708+shivamtiwari3@users.noreply.github.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
#13843
file parts that are not images (e.g., application/pdf) are silently dropped from the request body. The SDK logs a warning (unsupported file content type), but the resulting API request is sent without the file data, often causing the model to respond that no document was provided.
The OpenAI Responses API supports non-image files via the input_file part
Summary
adds support for non-image file inputs, especially PDFs, by mapping them to OpenAI Responses input_file parts:
{ type: 'input_file', file_url: '...' }{ type: 'input_file', filename, file_data: 'data:<mediaType>;base64,...' }Manual Verification
verified by running the cli examples
Checklist
pnpm changesetin the project root)Related Issues
fixes #13843
Co-authored-by: shivamtiwari3 33183708+shivamtiwari3@users.noreply.github.com