Skip to main content
The thinking layer adds a context-aware reasoning phase before the model generates its response. The agent analyzes the request, plans its approach, and considers available tools before executing.

Enable Thinking

Custom Configuration

str | Model
Model for the thinking phase. Defaults to the agent’s model.
str
Custom prompt for the thinking phase.

How It Works

  1. Before calling the main model, the agent runs a thinking phase.
  2. The thinking model receives the user message, system prompt, and available tool descriptions.
  3. It produces reasoning steps (analysis, plan, considerations).
  4. These steps are injected into the system prompt for the main model call.
  5. The main model generates its response with the reasoning context.

Streaming Thinking Events

Imports