QuestionQ73

VerifiedImplement generative AI and agentic solutions

You have a Microsoft Foundry project containing an agent. The agent uses two tools:

  • Azure AI Search, to retrieve answers from a private product documentation index.
  • The web search tool, to retrieve public information from the internet.

For a specific run, you need the agent to deterministically retrieve information only from the internet.

What should you set tool_choice to?

Explanation

In the Foundry Agent Service, tool_choice is the mechanism that deterministically controls which tool an agent invokes on a given run. You can set it to "auto" (model decides), "required" (model must call some tool, but not necessarily a specific one), "none" (no tools called), or to a specific tool type object such as {"type": "bing_grounding"} or {"type": "azure_ai_search"} to force that exact tool to be used. To guarantee that a run retrieves information only from the internet (and not from the private Azure AI Search index), you must explicitly force the Bing/web search grounding tool by setting tool_choice to the tool-type object referencing the web search tool, rather than leaving the decision to the model ("auto") or only requiring some unspecified tool call ("required"). Forcing {"type": "azure_ai_search"} would instead guarantee use of the private documentation index, which is not the goal here.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!