Cohere

Parameter reference for the Cohere model class, covering request, client, and retry settings.

The Cohere model provides access to Cohere's language models.

Parameters

ParameterTypeDefaultDescription
idstr"command-a-03-2025"The ID of the Cohere model to use
namestr"cohere"The name of the model
providerstr"Cohere"The provider of the model
api_keyOptional[str]NoneThe API key for Cohere (defaults to CO_API_KEY env var)
max_tokensOptional[int]NoneMaximum number of tokens to generate
temperatureOptional[float]NoneControls randomness in the model's output
top_pOptional[float]NoneControls diversity via nucleus sampling (0.01 to 0.99)
top_kOptional[int]NoneControls diversity via top-k sampling
seedOptional[int]NoneRandom seed for best-effort repeatability. Identical requests can still differ
frequency_penaltyOptional[float]NoneReduces repetition by penalizing frequent tokens (0.0 to 1.0)
presence_penaltyOptional[float]NoneReduces repetition by penalizing present tokens (0.0 to 1.0)
logprobsOptional[bool]NoneReturn log probabilities of the output tokens
strict_toolsboolFalseEnforce strict tool schemas in requests
add_chat_historyboolFalseCurrently unused. Request construction does not read this value
request_paramsOptional[Dict[str, Any]]NoneAdditional parameters to include in the request
client_paramsOptional[Dict[str, Any]]NoneCurrently unused. Client construction does not merge this mapping
http_clientOptional[Union[httpx.Client, httpx.AsyncClient]]NoneCustom HTTP client for requests
clientOptional[CohereClient]NonePre-configured Cohere client
async_clientOptional[CohereAsyncClient]NonePre-configured async Cohere client
model_typeModelTypeModelType.MODELFunctional role of this model (e.g. MODEL, OUTPUT_MODEL, PARSER_MODEL). Set by the agent
supports_native_structured_outputsboolFalseWhether the model supports structured outputs natively
supports_json_schema_outputsboolFalseWhether the model uses JSON schema for structured outputs
system_promptOptional[str]NoneSystem prompt from the model added to the agent
instructionsOptional[List[str]]NoneInstructions from the model added to the agent
tool_message_rolestr"tool"Role of tool messages
assistant_message_rolestr"assistant"Role of assistant messages
cache_responseboolFalseCache model responses to avoid redundant API calls during development
cache_ttlOptional[int]NoneTime-to-live for cached responses, in seconds
cache_dirOptional[str]NoneDirectory for the response cache. Defaults to ~/.agno/cache/model_responses
retriesint0Number of retries to attempt before raising a ModelProviderError
delay_between_retriesint1Delay between retries, in seconds
exponential_backoffboolFalseIf True, the delay between retries is doubled each time
retry_with_guidanceboolTrueRetry a failed model invocation once with a guidance message appended
retry_with_guidance_limitint1Number of times to retry the model invocation with guidance

add_chat_history does not affect message construction, and client_params is not passed to either Cohere client.