QuestionQ122

Implement generative AI and agentic solutions

You have a Microsoft Foundry project that includes an agent. The agent has a Model Context Protocol (MCP) tool named kbsearch that queries a knowledge base stored in Azure AI Search.

Some agent runs produce answers from the base model without calling the knowledge base, resulting in responses that lack grounded citations.

You are given the following code snippet used to run the agent.

Question Image

You need to deterministically require the agent to invoke kbsearch on every run.

What should you do?

  • A Add the response_format parameter to the create_and_process() method call.
  • B Replace create_and_process() method with the create_thread_and_process_run() method.
  • C Add the toolset parameter to the create_and_process() method call.
  • D Add the tool_choice parameter to the create_and_process() method call.
Explanation

tool_choice is the deterministic run-level control for requiring a specific tool call. Setting it in create_and_process() to select kbsearch prevents the default automatic model decision from bypassing the knowledge-base tool, so responses are grounded in its results.

Learn more

Community Discussion

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