Skip to main content

Overview

AWS Bedrock provides access to multiple foundation models from Amazon, Anthropic, Meta, Mistral, and others through a single API. Enterprise-grade with AWS security and compliance. Model Class: BedrockConverseModel

Authentication

export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_REGION="us-east-1"

Examples

from upsonic import Agent, Task
from upsonic.models.bedrock import BedrockConverseModel

model = BedrockConverseModel(model_name="anthropic.claude-3-5-sonnet-20241022-v2:0")
agent = Agent(model=model)

task = Task("Hello, how are you?")
result = agent.do(task)
print(result)

Parameters

ParameterTypeDescriptionDefaultSource
max_tokensintMaximum tokens to generate2048Base
temperaturefloatSampling temperature (0.0-1.0)1.0Base
top_pfloatNucleus sampling1.0Base
stop_sequenceslist[str]Stop sequencesNoneBase
timeoutfloatRequest timeout (seconds)600Base
bedrock_guardrail_configdictContent moderation configurationNoneSpecific
bedrock_performance_configurationdictLatency optimization settingsNoneSpecific