Model wrapper that returns outputs formatted to match the given schema.
Given schema can be a Pydantic class or a dict.
The output schema as a dict or a Pydantic class. If a Pydantic
class then the model output will be an object of that class. If a dict
then the model output will be a dict.
The method for steering model generation, one of:
'function_calling' or 'tool_calling':
Uses Cohere's tool-calling (formerly called function calling)
API: https://docs.cohere.com/v2/docs/tool-use
'json_schema':
Uses Cohere's Structured Output API: https://docs.cohere.com/docs/structured-outputs
Allows the user to pass a json schema (or pydantic) to the model for structured output.
This is the default method.
Supported for 'command-a-03-2025' and later models.
'json_mode':
Uses Cohere's Structured Output API: https://docs.cohere.com/docs/structured-outputs
Supported for 'command-a-03-2025' and later models.