Skip to content

Commit 711a0f6

Browse files
authored
Upgrade bedrock model to Sonnet 4.5 and fix issues with bean wiring (#327)
1 parent 59ef007 commit 711a0f6

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

pet_clinic_ai_agents/nutrition_agent/nutrition_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from strands.models import BedrockModel
88
from bedrock_agentcore.runtime import BedrockAgentCoreApp
99

10-
BEDROCK_MODEL_ID = "us.anthropic.claude-3-5-haiku-20241022-v1:0"
10+
BEDROCK_MODEL_ID = "anthropic.claude-sonnet-4-5-20250929-v1:0"
1111
NUTRITION_SERVICE_URL = os.environ.get('NUTRITION_SERVICE_URL')
1212

1313
agent = None

pet_clinic_ai_agents/primary_agent/pet_clinic_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from bedrock_agentcore.runtime import BedrockAgentCoreApp
99
from botocore.exceptions import ClientError
1010

11-
BEDROCK_MODEL_ID = "us.anthropic.claude-3-5-haiku-20241022-v1:0"
11+
BEDROCK_MODEL_ID = "anthropic.claude-sonnet-4-5-20250929-v1:0"
1212

1313
@tool
1414
def get_clinic_hours():

spring-petclinic-api-gateway/src/main/java/org/springframework/samples/petclinic/api/boundary/web/AgentController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ public class AgentController {
3030

3131
private String nutritionAgentArn = System.getenv("NUTRITION_AGENT_ARN");
3232

33-
private String awsRegion = "us-east-1";
33+
private String awsRegion = System.getenv().getOrDefault("AWS_REGION", "us-east-1");
3434

3535
private final BedrockAgentCoreClient bedrockClient;
3636
private final String sessionId;
3737

38-
public AgentController(String region) {
38+
public AgentController() {
3939
this.bedrockClient = BedrockAgentCoreClient.builder()
4040
.region(Region.of(awsRegion))
4141
.credentialsProvider(software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider.builder().build())
@@ -68,7 +68,7 @@ private Map<String, Object> invokeAgent(String query) throws Exception {
6868
String payload = String.format("{\"prompt\": \"%s\"}", escapeJson(prompt));
6969

7070
InvokeAgentRuntimeRequest invokeRequest = InvokeAgentRuntimeRequest.builder()
71-
.agentRuntimeArn("arn:aws:bedrock-agentcore:us-east-1:140023401067:runtime/pet_clinic_agent-1237f9CoGU")
71+
.agentRuntimeArn(primaryAgentArn)
7272
.qualifier("DEFAULT")
7373
.runtimeSessionId(sessionId)
7474
.contentType("application/json")

0 commit comments

Comments
 (0)