Skip to main content
Set output_model to generate the final answer with a second model after the primary model handles the run.

How It Works

  1. The primary model processes the request and handles tool calls.
  2. Agno removes the primary model’s final assistant message from the run history.
  3. output_model generates a replacement response from the remaining history, including the user request and tool results.
  4. If parser_model is configured, it parses that replacement into output_schema.
output_model receives the run history with the primary final response removed. Use parser_model when the next model must transform the generated content into a Pydantic object.

Choose a Pipeline

Each secondary model adds a model call to the run.

Parameters

parser_model requires output_schema. Agno logs a warning and skips parsing when no schema is set.

Control the Output Model

output_model_prompt replaces the existing system message for the output-model call. Agno inserts it when the run history has no system message.

Parse into a Schema

The parser model receives the preceding model’s content as its user message.
Agno supplies a default structured-output instruction when parser_model_prompt is unset. Set a custom prompt for extraction rules such as date formats, item limits, or field-specific constraints.

Combine Output and Parser Models

output_model runs before parser_model. The parser therefore structures the output model’s replacement response.