Skip to content

Commit 2f9a416

Browse files
author
Yuriy Bezsonov
committed
fix(java-spring-ai-agents): add validation starter, use non-deprecated bedrock props
- Add spring-boot-starter-validation: RC2 KB config properties are @validated, so the aiagent needs a Bean Validation implementation or it fails to start - Switch to non-deprecated spring.ai.bedrock.converse.chat.* property keys (max-tokens, model, temperature) in app + demo-scripts
1 parent d2b5014 commit 2f9a416

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

apps/java-spring-ai-agents/aiagent/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@
7373
<dependency>
7474
<groupId>org.springframework.ai</groupId>
7575
<artifactId>spring-ai-vector-store-advisor</artifactId>
76+
</dependency>
77+
<!-- Bean Validation implementation (Hibernate Validator) for @Validated config properties -->
78+
<dependency>
79+
<groupId>org.springframework.boot</groupId>
80+
<artifactId>spring-boot-starter-validation</artifactId>
7681
</dependency>
7782
<!-- AgentCore Memory dependencies -->
7883
<dependency>

apps/java-spring-ai-agents/aiagent/src/main/resources/application.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ logging.level.com.example.agent=DEBUG
66
logging.pattern.console=%msg%n
77
# Amazon Bedrock Configuration
88
spring.ai.bedrock.aws.timeout=120s
9-
spring.ai.bedrock.converse.chat.options.max-tokens=4096
10-
spring.ai.bedrock.converse.chat.options.model=global.anthropic.claude-sonnet-4-6
11-
spring.ai.bedrock.converse.chat.options.temperature=0.7
9+
spring.ai.bedrock.converse.chat.max-tokens=4096
10+
spring.ai.bedrock.converse.chat.model=global.anthropic.claude-sonnet-4-6
11+
spring.ai.bedrock.converse.chat.temperature=0.7
1212
# AgentCore Browser - tool descriptions
1313
agentcore.browser.browse-url-description=Browse a web page and extract its text content. Returns the page title and body text. Use this to read and extract data from websites. For interactive sites, combine with fillForm and clickElement to navigate, then call browseUrl again to read the results.
1414
agentcore.browser.screenshot-description=Take a screenshot of a web page for the user to see. Does NOT return page content to you. Use browseUrl to extract data first, then takeScreenshot for visual evidence.

apps/java-spring-ai-agents/demo-scripts/01-create.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ logging.level.com.example.agent=DEBUG
6969
logging.pattern.console=%msg%n
7070
# Amazon Bedrock Configuration
7171
spring.ai.bedrock.aws.timeout=120s
72-
spring.ai.bedrock.converse.chat.options.max-tokens=4096
73-
spring.ai.bedrock.converse.chat.options.model=global.anthropic.claude-sonnet-4-6
74-
spring.ai.bedrock.converse.chat.options.temperature=0.7
72+
spring.ai.bedrock.converse.chat.max-tokens=4096
73+
spring.ai.bedrock.converse.chat.model=global.anthropic.claude-sonnet-4-6
74+
spring.ai.bedrock.converse.chat.temperature=0.7
7575
EOF
7676

7777
# --- Write ChatService.java ---

0 commit comments

Comments
 (0)