Skip to content

Commit e5a81e6

Browse files
authored
Merge branch 'spring-projects:main' into main
2 parents 9368d1a + 44816fb commit e5a81e6

File tree

24 files changed

+669
-62
lines changed

24 files changed

+669
-62
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ shell.log
4343
/spring-ai-spring-boot-autoconfigure/nbproject/
4444
/vector-stores/spring-ai-cassandra-store/nbproject/
4545

46+
CLAUDE.md
4647
**/.claude/settings.local.json
4748
.devcontainer
4849

auto-configurations/models/spring-ai-autoconfigure-model-bedrock-ai/src/main/java/org/springframework/ai/model/bedrock/converse/autoconfigure/BedrockConverseProxyChatProperties.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024-2024 the original author or authors.
2+
* Copyright 2024-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
1616

1717
package org.springframework.ai.model.bedrock.converse.autoconfigure;
1818

19-
import org.springframework.ai.model.tool.ToolCallingChatOptions;
19+
import org.springframework.ai.bedrock.converse.BedrockChatOptions;
2020
import org.springframework.boot.context.properties.ConfigurationProperties;
2121
import org.springframework.boot.context.properties.NestedConfigurationProperty;
2222
import org.springframework.util.Assert;
@@ -33,14 +33,14 @@ public class BedrockConverseProxyChatProperties {
3333
public static final String CONFIG_PREFIX = "spring.ai.bedrock.converse.chat";
3434

3535
@NestedConfigurationProperty
36-
private ToolCallingChatOptions options = ToolCallingChatOptions.builder().temperature(0.7).maxTokens(300).build();
36+
private BedrockChatOptions options = BedrockChatOptions.builder().temperature(0.7).maxTokens(300).build();
3737

38-
public ToolCallingChatOptions getOptions() {
38+
public BedrockChatOptions getOptions() {
3939
return this.options;
4040
}
4141

42-
public void setOptions(ToolCallingChatOptions options) {
43-
Assert.notNull(options, "ToolCallingChatOptions must not be null");
42+
public void setOptions(BedrockChatOptions options) {
43+
Assert.notNull(options, "BedrockChatOptions must not be null");
4444
this.options = options;
4545
}
4646

auto-configurations/models/spring-ai-autoconfigure-model-bedrock-ai/src/test/java/org/springframework/ai/model/bedrock/converse/autoconfigure/tool/FunctionCallWithFunctionBeanIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.junit.jupiter.api.Test;
2424
import org.slf4j.Logger;
2525
import org.slf4j.LoggerFactory;
26+
import org.springframework.ai.bedrock.converse.BedrockChatOptions;
2627
import reactor.core.publisher.Flux;
2728

2829
import org.springframework.ai.bedrock.converse.BedrockProxyChatModel;
@@ -32,7 +33,6 @@
3233
import org.springframework.ai.model.bedrock.autoconfigure.BedrockTestUtils;
3334
import org.springframework.ai.model.bedrock.autoconfigure.RequiresAwsCredentials;
3435
import org.springframework.ai.model.bedrock.converse.autoconfigure.BedrockConverseProxyChatAutoConfiguration;
35-
import org.springframework.ai.model.tool.ToolCallingChatOptions;
3636
import org.springframework.boot.autoconfigure.AutoConfigurations;
3737
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
3838
import org.springframework.context.annotation.Bean;
@@ -64,14 +64,14 @@ void functionCallTest() {
6464
"What's the weather like in San Francisco, in Paris, France and in Tokyo, Japan? Return the temperature in Celsius.");
6565

6666
ChatResponse response = chatModel.call(new Prompt(List.of(userMessage),
67-
ToolCallingChatOptions.builder().toolNames("weatherFunction").build()));
67+
BedrockChatOptions.builder().toolNames("weatherFunction").build()));
6868

6969
logger.info("Response: {}", response);
7070

7171
assertThat(response.getResult().getOutput().getText()).contains("30", "10", "15");
7272

7373
response = chatModel.call(new Prompt(List.of(userMessage),
74-
ToolCallingChatOptions.builder().toolNames("weatherFunction3").build()));
74+
BedrockChatOptions.builder().toolNames("weatherFunction3").build()));
7575

7676
logger.info("Response: {}", response);
7777

@@ -93,7 +93,7 @@ void functionStreamTest() {
9393
"What's the weather like in San Francisco, in Paris, France and in Tokyo, Japan? Return the temperature in Celsius.");
9494

9595
Flux<ChatResponse> responses = chatModel.stream(new Prompt(List.of(userMessage),
96-
ToolCallingChatOptions.builder().toolNames("weatherFunction").build()));
96+
BedrockChatOptions.builder().toolNames("weatherFunction").build()));
9797

9898
String content = responses.collectList()
9999
.block()

auto-configurations/models/spring-ai-autoconfigure-model-bedrock-ai/src/test/java/org/springframework/ai/model/bedrock/converse/autoconfigure/tool/FunctionCallWithPromptFunctionIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 the original author or authors.
2+
* Copyright 2023-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,14 +22,14 @@
2222
import org.slf4j.Logger;
2323
import org.slf4j.LoggerFactory;
2424

25+
import org.springframework.ai.bedrock.converse.BedrockChatOptions;
2526
import org.springframework.ai.bedrock.converse.BedrockProxyChatModel;
2627
import org.springframework.ai.chat.messages.UserMessage;
2728
import org.springframework.ai.chat.model.ChatResponse;
2829
import org.springframework.ai.chat.prompt.Prompt;
2930
import org.springframework.ai.model.bedrock.autoconfigure.BedrockTestUtils;
3031
import org.springframework.ai.model.bedrock.autoconfigure.RequiresAwsCredentials;
3132
import org.springframework.ai.model.bedrock.converse.autoconfigure.BedrockConverseProxyChatAutoConfiguration;
32-
import org.springframework.ai.model.tool.ToolCallingChatOptions;
3333
import org.springframework.ai.tool.function.FunctionToolCallback;
3434
import org.springframework.boot.autoconfigure.AutoConfigurations;
3535
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
@@ -56,7 +56,7 @@ void functionCallTest() {
5656
UserMessage userMessage = new UserMessage(
5757
"What's the weather like in San Francisco, in Paris and in Tokyo? Return the temperature in Celsius.");
5858

59-
var promptOptions = ToolCallingChatOptions.builder()
59+
var promptOptions = BedrockChatOptions.builder()
6060
.toolCallbacks(
6161
List.of(FunctionToolCallback.builder("CurrentWeatherService", new MockWeatherService())
6262
.description("Get the weather in location. Return temperature in 36°F or 36°C format.")

mcp/common/src/test/java/org/springframework/ai/mcp/AsyncMcpToolCallbackTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void callShouldThrowOnError() {
3434
assertThatThrownBy(() -> callback.call("{\"param\":\"value\"}")).isInstanceOf(ToolExecutionException.class)
3535
.cause()
3636
.isInstanceOf(IllegalStateException.class)
37-
.hasMessage("Error calling tool: [TextContent[annotations=null, text=Some error data]]");
37+
.hasMessage("Error calling tool: [TextContent[annotations=null, text=Some error data, meta=null]]");
3838
}
3939

4040
@Test

mcp/common/src/test/java/org/springframework/ai/mcp/SyncMcpToolCallbackTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void callShouldThrowOnError() {
114114
assertThatThrownBy(() -> callback.call("{\"param\":\"value\"}")).isInstanceOf(ToolExecutionException.class)
115115
.cause()
116116
.isInstanceOf(IllegalStateException.class)
117-
.hasMessage("Error calling tool: [TextContent[annotations=null, text=Some error data]]");
117+
.hasMessage("Error calling tool: [TextContent[annotations=null, text=Some error data, meta=null]]");
118118
}
119119

120120
@Test

0 commit comments

Comments
 (0)