Share via

Microsoft foundry(new)

Sreeja Mulkalapally 20 Reputation points
2026-03-06T11:11:48.87+00:00

am using azure-ai-projects==2.0.0b3 and invoking agents using responses.create() with agent_reference.

I need to attach .xlsx or .csv files to Code Interpreter container when creating the response. I upload the file using the OpenAI file API and obtain the file_id.

However, I cannot find any parameter in responses.create() or conversation.item.create() with agent_reference to pass the file_id.

in the microsoft foundry classic SDK shows file attachments using MessageAttachment and tools=[CodeInterpreterToolDefination. but microsoft foundry new SDK doesnt have that atachment option.

Could you please point to the documentation that explains how to pass a file_id when using agent_reference, or confirm if this capability is not currently supported?

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform

0 comments No comments

Answer accepted by question author
  1. Q&A Assist
    2026-03-06T11:12:01.12+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    This capability is not documented as supported in the new Microsoft Foundry agents experience when using responses.create() with agent_reference.

    In the classic model, files could be attached to a thread message (for example via MessageAttachment), which then became available to tools like Code Interpreter or file search on that thread-specific vector store. In the new model:

    • responses.create() is a simplified, synchronous execution API that takes input, optional conversation, and an agent_reference in extra_body.
    • The available documentation for tools focuses on:
      • File search, where files are uploaded, added to a vector store, and then attached at the agent or conversation level, not passed as file_id parameters on responses.create().
      • Code Interpreter, where troubleshooting covers upload/download of files via annotations and containers, but does not describe any file_id argument on responses.create() or conversation item creation.

    The provided references show how to:

    • Upload files and create vector stores for file search, including the requirement purpose="assistants" and supported file types such as .csv (as text/plain or text/csv-compatible) and .pdf, .json, etc., but only in the context of file search and vector stores, not Code Interpreter containers.
    • Use the new responses.create() API with agent_reference for executing agent logic, without any documented mechanism to attach files by file_id in the request body.

    Because no parameter or pattern is documented for passing file_id into responses.create() or conversation.item.create() with agent_reference, and the only file-handling patterns described are:

    • File search via vector stores attached to agents or conversations, and
    • Classic agents/threads with message attachments,

    the ability to directly attach uploaded files to a Code Interpreter container at responses.create() time is not currently documented or supported in the new agents SDK.

    The supported and documented file-related options in the new experience are:

    1. Use file search: upload files, create a vector store, and attach it to the agent or conversation so the agent can retrieve content from those files.
    2. For Code Interpreter, rely on the tool’s own file upload/download flow via annotations (for example container_file_citation), not via a file_id parameter on responses.create().

    References:

3 additional answers

Sort by: Most helpful
  1. Sreeja Mulkalapally 20 Reputation points
    2026-03-06T11:23:16.9366667+00:00

    upload a file to Code Interpreter after an agent creation with Code Interpreter.

    0 comments No comments

  2. Sreeja Mulkalapally 20 Reputation points
    2026-03-06T11:22:43.1133333+00:00

    upload a file to Code Interpreter after an agent creation with Code Interpreter.

    0 comments No comments

  3. Sreeja Mulkalapally 20 Reputation points
    2026-03-06T11:18:42.6633333+00:00

    Do we have anyway to attach the uploaded fileid (which is .xlsx file uploaded to openai) attach with user query ?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.