← Learn

Tool use

Letting a model call external functions — search, code execution, APIs, browsers — mid-generation so it can act on the world instead of only emitting text.

Learn

When to use it

Use tool use when a model's ability to generate text alone is insufficient for the task. Tool use allows models to interact with external systems, enabling actions like executing code or retrieving real-time data through APIs.

Quick example

In ChatGPT, a model might need to fetch the latest weather data to answer a user's query. By enabling tool use, the model can call a weather API mid-generation to retrieve accurate information. Here, ChatGPT includes tool use as a feature, allowing the model to act beyond static text generation.

prompt → model → tool use → API call → response

Ecosystem

Tool use integrates into the broader model interaction loop, enabling dynamic responses and real-world actions.

        ┌─ code execution ─┐
prompt →│    tool use     │→ text
        └─── API call ────┘

Misconceptions

MisconceptionRebuttal
It changes the model weightsTool use only extends functionality during generation
Models inherently know how to use toolsTool use requires explicit configuration and permissions

Trade-offs

  • Dynamic capabilities — increased complexity in managing permissions
  • Real-time data — potential latency from external calls
  • Expanded functionality — dependency on external service availability

Seen in