Let the agent choose: tool calls or code18 November 2026·2645 words·13 minsMachine Learning & AI Pydantic Ai Agents Code Mode Monty Tool Calling PythonGive one agent both ordinary tool calls and Code Mode, let it pick per step, and measure which route it takes, when it switches, and what still goes wrong.