A community member has associated this post with a similar question:
Azure OpenAI ALWAYS Throwing an unhandled Error when submitting a Thread Run with parameter tool_choice set to "type":"file_search" on GPT4.1-mini

Only moderators can edit this content.

Azure OpenAI Throwing server_error exception when submitting a Thread Run with parameter tool_choice set to "type":"file_search" on GPT4.1-mini

David Captur 160 Reputation points
2025-06-19T10:44:07.76+00:00

Hi there,

I am currently using Assistants/Threads/Runs to chat with a configured assistant in Azure OpenAI which has File Search enabled and some configured functions. I want it as much as possible to use the file search and get its answers from there, so when I post the Run, I am setting this body:

SQLCopy

JSONCopy

{
   "assistant_id":"{{AssistantID}}",
   "tool_choice":{
      "type":"file_search"
   },
   "parallel_tool_calls":true,
}

When on the assistant side I set the model to be GPT4.1-mini, I am ALWAYS getting an unhandled server error as shown below:

User's image

Error text:

Copy

TypeScriptCopy

"last_error"

This is happening with all requests, even passing something as simple as "hello there".

If I change models to GPT4o or GPT4o-mini, the problem does not occur!

The problem ALSO does not occur if I empty the vector store that the Assistant is using, though that creates different problems. This is an OpenAI Bug clearly, has anyone else encountered it?

Community Center Not monitored
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 33,071 Reputation points Volunteer Moderator
    2025-06-19T21:28:00.2633333+00:00

    Hello David !

    Thank you for posting on Microsoft Learn.

    I think you are having an internal bug in the implementation of GPT-4.1-mini, specifically when it attempts to interface with the file search tool (likely related to the vector store or embedding compatibility).

    You can use GPT-4o or GPT-4o-mini for now if you rely on file_search.

    Clear the vector store or avoid complex file setups temporarily if GPT-4.1-mini must be used (though that limits usefulness).

    For better assistance, try to report the bug to Microsoft Support.