Support for `"tool_choice": "required"` in Azure OpenAI service

peter.kadlot 5 Reputation points
2024-06-03T15:17:23.4733333+00:00
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,523 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 29,986 Reputation points
    2024-06-04T03:44:36.9866667+00:00

    peter.kadlot Greetings & Welcome to Microsoft Q&A forum!

    https://learn.microsoft.com/en-us/azure/ai-services/openai/reference doesn't yet support "tool_choice":"required" while it is already available in https://platform.openai.com/docs/api-reference/chat/create#chat-create-tool_choice

    AFAIK, these features will be available in the next releases. We don't have any exact ETA which can be shared now.

    I would suggest you, keep an eye on the What's new in Azure OpenAI Service for more updates.

    0 comments No comments

  2. Daksh Kalucha 20 Reputation points
    2024-06-19T12:39:54.1533333+00:00

    @peter.kadlot

    Openai offers two ways to customize the default behavior depending on your use case:

    1. To force the model to always call one or more tools, you can set tool_choice: "required". The model will then select which tool to call. AzureOpenAI doesn't support this method.
    2. To force the model to call only one specific function, you can set tool_choice: {"type": "file_search"}.

    Use the second way, it worked for me.

    0 comments No comments