Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions contrib/spring-ai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<description>Spring AI integration for the Agent Development Kit.</description>

<properties>
<spring-ai.version>2.0.0-M3</spring-ai.version>
<spring-ai.version>2.0.0</spring-ai.version>
<testcontainers.version>1.21.3</testcontainers.version>
</properties>

Expand Down Expand Up @@ -124,21 +124,11 @@
<artifactId>spring-ai-anthropic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-vertex-ai-gemini</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-google-genai</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-azure-openai</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-ollama</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void testSimpleAgentWithRealGeminiApi() throws InterruptedException {
GoogleGenAiChatOptions options = GoogleGenAiChatOptions.builder().model(GEMINI_MODEL).build();

GoogleGenAiChatModel geminiModel =
GoogleGenAiChatModel.builder().genAiClient(genAiClient).defaultOptions(options).build();
GoogleGenAiChatModel.builder().genAiClient(genAiClient).options(options).build();

// Wrap with SpringAI
SpringAI springAI = new SpringAI(geminiModel, GEMINI_MODEL);
Expand Down Expand Up @@ -104,7 +104,7 @@ void testStreamingWithRealGeminiApi() throws InterruptedException {
GoogleGenAiChatOptions options = GoogleGenAiChatOptions.builder().model(GEMINI_MODEL).build();

GoogleGenAiChatModel geminiModel =
GoogleGenAiChatModel.builder().genAiClient(genAiClient).defaultOptions(options).build();
GoogleGenAiChatModel.builder().genAiClient(genAiClient).options(options).build();

SpringAI springAI = new SpringAI(geminiModel, GEMINI_MODEL);

Expand Down Expand Up @@ -149,7 +149,7 @@ void testAgentWithToolsAndRealApi() {
GoogleGenAiChatOptions options = GoogleGenAiChatOptions.builder().model(GEMINI_MODEL).build();

GoogleGenAiChatModel geminiModel =
GoogleGenAiChatModel.builder().genAiClient(genAiClient).defaultOptions(options).build();
GoogleGenAiChatModel.builder().genAiClient(genAiClient).options(options).build();

LlmAgent agent =
LlmAgent.builder()
Expand Down Expand Up @@ -193,7 +193,7 @@ void testDirectComparisonNonStreamingVsStreaming() throws InterruptedException {
GoogleGenAiChatOptions options = GoogleGenAiChatOptions.builder().model(GEMINI_MODEL).build();

GoogleGenAiChatModel geminiModel =
GoogleGenAiChatModel.builder().genAiClient(genAiClient).defaultOptions(options).build();
GoogleGenAiChatModel.builder().genAiClient(genAiClient).options(options).build();

SpringAI springAI = new SpringAI(geminiModel, GEMINI_MODEL);

Expand Down Expand Up @@ -298,7 +298,7 @@ void testConfigurationOptions() {
Client.builder().apiKey(System.getenv("GOOGLE_API_KEY")).vertexAI(false).build();

GoogleGenAiChatModel geminiModel =
GoogleGenAiChatModel.builder().genAiClient(genAiClient).defaultOptions(options).build();
GoogleGenAiChatModel.builder().genAiClient(genAiClient).options(options).build();

SpringAI springAI = new SpringAI(geminiModel, GEMINI_MODEL);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.springframework.ai.openai.OpenAiChatModel;
import org.springframework.ai.openai.OpenAiChatOptions;
import org.springframework.ai.openai.api.OpenAiApi;

/**
* Integration tests with real OpenAI API.
Expand All @@ -50,8 +49,14 @@ class OpenAiApiIntegrationTest {
@Test
void testSimpleAgentWithRealOpenAiApi() {
// Create OpenAI model using Spring AI's builder pattern
OpenAiApi openAiApi = OpenAiApi.builder().apiKey(System.getenv("OPENAI_API_KEY")).build();
OpenAiChatModel openAiModel = OpenAiChatModel.builder().openAiApi(openAiApi).build();
OpenAiChatModel openAiModel =
OpenAiChatModel.builder()
.options(
OpenAiChatOptions.builder()
.apiKey(System.getenv("OPENAI_API_KEY"))
.model(GPT_MODEL)
.build())
.build();

// Wrap with SpringAI
SpringAI springAI = new SpringAI(openAiModel, GPT_MODEL);
Expand Down Expand Up @@ -84,8 +89,14 @@ void testSimpleAgentWithRealOpenAiApi() {

@Test
void testStreamingWithRealOpenAiApi() {
OpenAiApi openAiApi = OpenAiApi.builder().apiKey(System.getenv("OPENAI_API_KEY")).build();
OpenAiChatModel openAiModel = OpenAiChatModel.builder().openAiApi(openAiApi).build();
OpenAiChatModel openAiModel =
OpenAiChatModel.builder()
.options(
OpenAiChatOptions.builder()
.apiKey(System.getenv("OPENAI_API_KEY"))
.model(GPT_MODEL)
.build())
.build();

SpringAI springAI = new SpringAI(openAiModel, GPT_MODEL);

Expand Down Expand Up @@ -124,8 +135,14 @@ void testStreamingWithRealOpenAiApi() {

@Test
void testAgentWithToolsAndRealApi() {
OpenAiApi openAiApi = OpenAiApi.builder().apiKey(System.getenv("OPENAI_API_KEY")).build();
OpenAiChatModel openAiModel = OpenAiChatModel.builder().openAiApi(openAiApi).build();
OpenAiChatModel openAiModel =
OpenAiChatModel.builder()
.options(
OpenAiChatOptions.builder()
.apiKey(System.getenv("OPENAI_API_KEY"))
.model(GPT_MODEL)
.build())
.build();

LlmAgent agent =
LlmAgent.builder()
Expand Down Expand Up @@ -164,11 +181,14 @@ void testAgentWithToolsAndRealApi() {
void testConfigurationOptions() {
// Test with custom configuration
OpenAiChatOptions options =
OpenAiChatOptions.builder().model(GPT_MODEL).temperature(0.7).maxTokens(100).build();
OpenAiChatOptions.builder()
.apiKey(System.getenv("OPENAI_API_KEY"))
.model(GPT_MODEL)
.temperature(0.7)
.maxTokens(100)
.build();

OpenAiApi openAiApi = OpenAiApi.builder().apiKey(System.getenv("OPENAI_API_KEY")).build();
OpenAiChatModel openAiModel =
OpenAiChatModel.builder().openAiApi(openAiApi).defaultOptions(options).build();
OpenAiChatModel openAiModel = OpenAiChatModel.builder().options(options).build();

SpringAI springAI = new SpringAI(openAiModel, GPT_MODEL);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static void setUpBeforeClass() {
OllamaChatOptions.builder().model(ollamaContainer.getModelName()).build();

OllamaChatModel chatModel =
OllamaChatModel.builder().ollamaApi(ollamaApi).defaultOptions(options).build();
OllamaChatModel.builder().ollamaApi(ollamaApi).options(options).build();
springAI = new SpringAI(chatModel, ollamaContainer.getModelName());
}

Expand Down
4 changes: 0 additions & 4 deletions dev/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@
<groupId>guru.nidi</groupId>
<artifactId>graphviz-java</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-common</artifactId>
Expand Down
14 changes: 8 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
<okhttp.version>5.3.2</okhttp.version>
<docker-java.version>3.7.0</docker-java.version>
<graphviz.version>0.18.1</graphviz.version>
<ecj.version>3.41.0</ecj.version>
<maven.version>3.9.0</maven.version>
<langchain4j.version>1.12.2</langchain4j.version>
<slf4j.version>2.0.17</slf4j.version>
Expand Down Expand Up @@ -264,11 +263,6 @@
<artifactId>graphviz-java</artifactId>
<version>${graphviz.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>${ecj.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
Expand Down Expand Up @@ -328,6 +322,14 @@
<target>${java.version}</target>
<release>${maven.compiler.release}</release>
<parameters>true</parameters>
<!-- Required for AutoValue. With incremental compilation enabled, the compiler
plugin can split the source set and run the AutoValue annotation processor over
only a subset of sources, so some generated AutoValue_* types are never produced.
That surfaces non-deterministically as "cannot be resolved to a type" at compile
time or TypeNotPresentException at runtime (notably on JDK 25). Forcing a single
javac pass over all sources makes annotation processing see every @AutoValue type
and become deterministic, independent of the build JDK. -->
<useIncrementalCompilation>false</useIncrementalCompilation>
<annotationProcessorPaths>
<path>
<groupId>com.google.auto.value</groupId>
Expand Down
Loading