Skip to content

Conversation

@trrwilson
Copy link
Member

When (and only when) using fine-tune as the purpose for uploading files, the OpenAI "Create File" operation behaves differently in AOAI/FDP relative to OpenAI:

  • A Content-Type header is required on the multipart/form-data part for file
  • A success code of 201 is used instead of 200
  • A different set of status values (including "pending" and "processed") is used

The Azure OpenAI library, by virtue of its [InternalsVisibleTo] relationship with the OpenAI library, implements a full replacement of some of the logic to account for this. We don't want to and can't have this kind of relationship going forward, so we need to achieve the same workarounds in a different way.

With this change, we use a pipeline policy to:

  • Insert the requisite Content-Type header in create file requests
  • Replace the default HTTP 200 classifier with a 200/201 classifier
  • Move parallel "status" values into a separate additional property (and align nominal value with OpenAI)

Mirroring Azure OpenAI, an extension method is also provided for OpenAIFile that can retrieve the wire value initially received.

Net effect: an OpenAIClient retrieved via an AgentsClient can now successfully use create/get file operations.

@trrwilson trrwilson merged commit 4cde55d into feature/ai-foundry/agents-v2 Oct 31, 2025
10 of 21 checks passed
@trrwilson trrwilson deleted the user/travisw/ai-foundry/agents-v2/ft-files-workaround branch October 31, 2025 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants