AWS Bedrock

Configuration reference for AwsBedrock, Agno's model class for models hosted on AWS Bedrock.

The AWS Bedrock model provides access to models hosted on AWS Bedrock.

Parameters

ParameterTypeDefaultDescription
idstr"mistral.mistral-small-2402-v1:0"The ID of the AWS Bedrock model to use
namestr"AwsBedrock"The name of the model
providerstr"AwsBedrock"The provider of the model
temperatureOptional[float]NoneControls randomness in the model's output
max_tokensOptional[int]NoneMaximum number of tokens to generate
top_pOptional[float]NoneControls diversity via nucleus sampling
stop_sequencesOptional[List[str]]NoneA list of strings that the model should stop generating text at
request_paramsOptional[Dict[str, Any]]NoneAdditional parameters to include in the request
append_trailing_user_messageOptional[bool]NoneAppend a trailing user message when required. When unset, enabled for models without prefill support
trailing_user_message_contentstr"continue"Content of the appended trailing user message
aws_regionOptional[str]NoneThe AWS region to use (defaults to AWS_REGION env var)
aws_access_key_idOptional[str]NoneAWS access key ID (defaults to AWS_ACCESS_KEY_ID env var)
aws_secret_access_keyOptional[str]NoneAWS secret access key (defaults to AWS_SECRET_ACCESS_KEY env var)
aws_session_tokenOptional[str]NoneAWS session token (defaults to AWS_SESSION_TOKEN env var)
aws_sso_authOptional[bool]FalseAuthenticate with the current profile's SSO session instead of access keys
sessionOptional[Session]Noneboto3 Session object to use for authentication
async_sessionOptional[Any]Noneaioboto3 Session object for async calls
clientOptional[AwsClient]NonePre-configured Bedrock runtime client
async_clientOptional[Any]NonePre-configured async Bedrock runtime 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