QuestionQ40

VerifiedImplement generative AI and agentic solutions

You have a Microsoft Foundry project containing a deployed ticket-triage agent.

You notice that the agent sometimes responds without calling any tools, even in cases where a tool is required.

You need to ensure the agent calls a tool during execution. How should you complete the Python code? A value can be used once, more than once, or not at all.

Drag & Drop
run_payload = {
    "assistant_id": agent_id,
    : ,
    "metadata": {
        "scenario": "ticket-triage"
    }
}
Explanation

Adding "tool_choice": "required" to the run payload forces the Foundry Agent Service to invoke an available tool on every run instead of allowing the model to respond directly without calling one, which resolves the ticket-triage agent's intermittent tool-skipping behavior; the default auto value permits the model to skip tool calls, which is the exact condition being reported.

Learn more

Community Discussion

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