Skip to content

Send non-PDF user files on the Responses API - #7949

Open
mahdidelzendeh72 wants to merge 2 commits into
dotnet:mainfrom
mahdidelzendeh72:support-non-pdf-responses-files
Open

mahdidelzendeh72 wants to merge 2 commits into
dotnet:mainfrom
mahdidelzendeh72:support-non-pdf-responses-files

Conversation

@mahdidelzendeh72

@mahdidelzendeh72 mahdidelzendeh72 commented Nov 16, 2026 •

Copy link
Copy Markdown

Summary

  • User messages on the Responses client only forwarded images and PDF files. The Responses API also accepts text, Office, and other documents as input_file.
  • Remaining user DataContent and non-image UriContent are now sent as input_file. Images and PDF keep their existing parts.
  • Chat Completions is unchanged. That API accepts only PDF as a file part.

Test plan

  • UserMessageWithNonPdfFile_ConvertsToInputFile sends text/plain bytes and an xlsx URL as input_file.
  • Existing UserMessageWithVariousContentTypes_ConvertsCorrectly still passes, so images and PDF are unchanged.
Microsoft Reviewers: Open in CodeFlow

@mahdidelzendeh72
mahdidelzendeh72 requested a review from a team as a code owner November 16, 2026 09:01
@github-actions github-actions Bot added the area-ai Microsoft.Extensions.AI libraries label Nov 16, 2026
@mahdidelzendeh72
mahdidelzendeh72 force-pushed the support-non-pdf-responses-files branch from 9835980 to 2ac8010 Compare November 16, 2026 09:08
Map remaining user DataContent and UriContent to input_file.
The Responses API accepts text, Office, and other documents.
Images and PDF keep their existing parts.
@mahdidelzendeh72
mahdidelzendeh72 force-pushed the support-non-pdf-responses-files branch from 2ac8010 to 10c9136 Compare November 16, 2026 09:15

@valkiara valkiara left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the new file branches through the existing non-streaming request test and an additional streaming request with mixed text, file bytes, and a file URL. Local conversion checks covered MIME/data preservation, explicit and generated filenames, document URLs with query strings, and image routing. I found no correctness issues in the changed paths.

The adapter suite passed on net11.0 with the pinned SDK 11.0.100-rc.3.26522.148 (397 passed, 163 live integration tests skipped). All eight additional local checks passed. Provider acceptance of the files was not tested live.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ai Microsoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants