Repository navigation
Description
Observed Behavior
responses_to_run only accepts input_file parts with file_url or file_id. A part with inline file_data raises ValueError.
OpenAIChatClient sends exactly that for Content.from_data(pdf_bytes, "application/pdf"): {"type": "input_file", "file_data": "data:application/pdf;base64,..."}. So an agent hosted with agent-framework-hosting-responses can't receive a local file from Agent Framework's own OpenAI client. I checked this end to end with OpenAIChatClient pointed at a small FastAPI app that calls responses_to_run: text works, text plus a PDF fails.
Expected Behavior
file_data is accepted like the other two forms (the Responses API allows file_id, file_url, or file_data) and becomes data content.
Steps to Reproduce
- Build a Responses request with an
input_filepart that usesfile_data - Pass it to
responses_to_run
Minimal Reproduction
import base64
from agent_framework_hosting_responses import responses_to_run
pdf = base64.b64encode(b"%PDF-1.4\n").decode()
# What OpenAIChatClient sends for Content.from_data(pdf_bytes, "application/pdf").
body = {
"input": [
{
"role": "user",
"content": [
{"type": "input_text", "text": "Summarize this file"},
{"type": "input_file", "file_data": f"data:application/pdf;base64,{pdf}"},
],
}
]
}
run = responses_to_run(body)
print([content.type for content in run["messages"][0].contents])Error Messages and Stack Traces
File ".../agent_framework_hosting_responses/_parsing.py", line 211, in _content_from_input_item
raise ValueError("input_file requires a non-empty string `file_url` or `file_id`")
ValueError: input_file requires a non-empty string `file_url` or `file_id`
Package Versions
agent-framework-core 1.25.0, agent-framework-hosting-responses 1.0.0a261106, agent-framework-openai 1.18.1 (main at 22b5e75), openai 3.36.1
Python Version
Python 3.12
Operating System
macOS
Regression
No
Additional Context
_content_from_input_item in _parsing.py has branches for file_url and file_id only. A fix could be to add a file_data branch that turns the data URI into data content. I have a fix with tests and will open a PR.
AI assistance: I used an AI assistant to help find the cause and write this up. I ran the repro myself.
Acknowledgements
- I searched existing issues and did not find a duplicate.
- I personally verified this behavior and the reproduction details are authentic.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Nov 11, 2026
Reproduced on main (22b5e75) with the minimal snippet from the report:
responses_to_runraisesValueError: input_file requires a non-empty string file_url or file_idat_parsing.py:211for aninput_filewithfile_data. Routed to thehosting-responsesowner. Support boundary: unclear from maintained docs, so scope is for a maintainer to decide. Open PR #10284 targets this. Run: https://github.com/microsoft/agent-framework/actions/runs/43113596535