Course contentsShow
← Machine Learning and Deep Learning
Lesson 1930 of 3,53841. Structured Output and Tool CallingFree lesson

Tool Choice Parameters

Controlling function calling behavior with auto, none, and required tool choice settings.

Tool Choice Parameters

What you'll learn: How to control when and whether an LLM should invoke functions using auto, none, and required tool choice settings.

Understanding Tool Choice Control

When you give an LLM access to functions (tools), you don't always want it to have complete freedom in deciding whether to call them. Tool choice parameters let you explicitly control this behavior, similar to setting "modes" on a camera: automatic, manual, or forced.

Think of it like a restaurant menu with a sommelier. Sometimes you want the sommelier to recommend wine only if appropriate (auto), sometimes you're driving and want no wine recommendations at all (none), and sometimes you're specifically there for wine pairing and want a recommendation guaranteed (required).

The Three Tool Choice Settings

auto (Default)

The LLM decides whether calling a function is appropriate based on the conversation context. If the user asks "What's the weather in Paris?", it calls the weather function. If they ask "What's your favorite color?", it responds directly without tools.

none

The LLM will never call functions, even if they would be useful. It responds purely conversationally using its training knowledge. Use this when you want pure text responses or when tool access should be temporarily disabled.

required

The LLM must call at least one function—it cannot respond without invoking a tool. Perfect for scenarios where you always need structured action, like data extraction pipelines or when you want to force classification through a specific function.

When to Use Each Setting

  • auto: General-purpose agents and chatbots
  • none: Explanatory responses, when external data is unavailable
  • required: Guaranteed structured output, classification tasks, extraction workflows

Key Takeaway: Tool choice parameters (auto, none, required) give you explicit control over whether your LLM can, must, or cannot invoke functions, enabling predictable behavior for different use cases.