Update docs references for the Spring AI model starters
- Update the documentation references to replace the artifact ID name change for the model starters Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
This commit is contained in:
committed by
Soby Chacko
parent
b37d3e568b
commit
836c01b048
@@ -101,9 +101,9 @@ One way to run integration tests on part of the code is to first do a quick comp
|
||||
```shell
|
||||
./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
|
||||
```
|
||||
Then run the integration test for a specifi module using the `-pl` option
|
||||
Then run the integration test for a specific module using the `-pl` option
|
||||
```shell
|
||||
./mvnw verify -Pintegration-tests -pl spring-ai-spring-boot-autoconfigure
|
||||
./mvnw verify -Pintegration-tests -pl spring-ai-spring-boot-testcontainers
|
||||
```
|
||||
|
||||
### Documentation
|
||||
|
||||
@@ -22,7 +22,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -31,7 +31,7 @@ or to your Gradle `build.gradle` build file:
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ To enable it, add the following dependency to your project's Maven `pom.xml` fil
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-azure-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-azure-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -27,7 +27,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-azure-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-azure-openai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -29,7 +29,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ Then add the Spring Boot Starter dependency to your project's Maven `pom.xml` bu
|
||||
[source,xml]
|
||||
----
|
||||
<dependency>
|
||||
<artifactId>spring-ai-bedrock-ai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-bedrock</artifactId>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
</dependency>
|
||||
----
|
||||
@@ -47,7 +47,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-bedrock-ai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-bedrock'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ Maven::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-anthropic-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-anthropic</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -50,7 +50,7 @@ Gradle::
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-anthropic-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-anthropic'
|
||||
}
|
||||
----
|
||||
======
|
||||
@@ -203,7 +203,7 @@ var response = this.chatModel.call(new Prompt(List.of(userMessage)));
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-anthropic-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-anthropic` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the Anthropic chat model:
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ Maven::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-azure-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-azure-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -104,14 +104,14 @@ Gradle::
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-azure-openai-spring-boot-starter'
|
||||
implementation 'spring-ai-starter-model-azure-openai'
|
||||
}
|
||||
----
|
||||
======
|
||||
|
||||
TIP: Refer to the xref:getting-started.adoc#dependency-management[Dependency Management] section to add the Spring AI BOM to your build file.
|
||||
|
||||
The Azure OpenAI Chat Client is created using the link:https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClientBuilder.java[OpenAIClientBuilder] provided by the Azure SDK. Spring AI allows to customize the builder by providing link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/azure/openai/AzureOpenAIClientBuilderCustomizer.java[AzureOpenAIClientBuilderCustomizer] beans.
|
||||
The Azure OpenAI Chat Client is created using the link:https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClientBuilder.java[OpenAIClientBuilder] provided by the Azure SDK. Spring AI allows to customize the builder by providing link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-azure-openai/src/main/java/org/springframework/ai/model/azure/openai/autoconfigure/AzureOpenAIClientBuilderCustomizer.java[AzureOpenAIClientBuilderCustomizer] beans.
|
||||
|
||||
A customizer might be used for example to change the default response timeout:
|
||||
|
||||
@@ -262,7 +262,7 @@ String response = ChatClient.create(chatModel).prompt()
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-azure-openai-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-azure-openai` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the OpenAi chat model:
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ Refer to https://docs.aws.amazon.com/bedrock/latest/userguide/getting-started.ht
|
||||
|
||||
== Auto-configuration
|
||||
|
||||
Add the `spring-ai-bedrock-converse-spring-boot-starter` dependency to your project's Maven `pom.xml` or Gradle `build.gradle` build files:
|
||||
Add the `spring-ai-starter-model-bedrock-converse` dependency to your project's Maven `pom.xml` or Gradle `build.gradle` build files:
|
||||
|
||||
[tabs]
|
||||
======
|
||||
@@ -42,7 +42,7 @@ Maven::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-bedrock-converse-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-bedrock-converse</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -51,7 +51,7 @@ Gradle::
|
||||
[source,gradle]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-bedrock-converse-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-bedrock-converse'
|
||||
}
|
||||
----
|
||||
======
|
||||
@@ -274,7 +274,7 @@ along with the text message "You are a very professional document summarization
|
||||
|
||||
== Sample Controller
|
||||
|
||||
Create a new Spring Boot project and add the `spring-ai-bedrock-converse-spring-boot-starter` to your dependencies.
|
||||
Create a new Spring Boot project and add the `spring-ai-starter-model-bedrock-converse` to your dependencies.
|
||||
|
||||
Add an `application.properties` file under `src/main/resources`:
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ Maven::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -61,7 +61,7 @@ Gradle::
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
|
||||
}
|
||||
----
|
||||
======
|
||||
@@ -163,7 +163,7 @@ NOTE: Currently, the DeepSeek API doesn't support media content.
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-openai-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-openai` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the OpenAi chat model:
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ public record Request(String location, Unit unit) {}
|
||||
|
||||
It is a best practice to annotate the request object with information such that the generated JSON schema of that function is as descriptive as possible to help the AI model pick the correct function to invoke.
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/anthropic/tool/FunctionCallWithFunctionBeanIT.java[FunctionCallWithFunctionBeanIT.java] demonstrates this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-anthropic/src/test/java/org/springframework/ai/model/anthropic/autoconfigure/tool/FunctionCallWithFunctionBeanIT.java[FunctionCallWithFunctionBeanIT.java] demonstrates this approach.
|
||||
|
||||
|
||||
==== FunctionCallback
|
||||
@@ -191,4 +191,4 @@ NOTE: The in-prompt registered functions are enabled by default for the duration
|
||||
|
||||
This approach allows to dynamically chose different functions to be called based on the user input.
|
||||
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/anthropic/tool/FunctionCallWithPromptFunctionIT.java[FunctionCallWithPromptFunctionIT.java] integration test provides a complete example of how to register a function with the `AnthropicChatModel` and use it in a prompt request.
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-anthropic/src/test/java/org/springframework/ai/model/anthropic/autoconfigure/tool/FunctionCallWithPromptFunctionIT.java[FunctionCallWithPromptFunctionIT.java] integration test provides a complete example of how to register a function with the `AnthropicChatModel` and use it in a prompt request.
|
||||
|
||||
@@ -111,7 +111,7 @@ public record Request(String location, Unit unit) {}
|
||||
|
||||
It is a best practice to annotate the request object with information such that the generated JSON schema of that function is as descriptive as possible to help the AI model pick the correct function to invoke.
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/azure/tool/FunctionCallWithFunctionBeanIT.java[FunctionCallWithFunctionBeanIT.java] demonstrates this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-anthropic/src/test/java/org/springframework/ai/model/azure/openai/autoconfigure/tool/FunctionCallWithFunctionBeanIT.java[FunctionCallWithFunctionBeanIT.java] demonstrates this approach.
|
||||
|
||||
==== FunctionCallback Wrapper
|
||||
|
||||
@@ -168,7 +168,7 @@ Here is the current weather for the requested cities:
|
||||
- Paris, France: 15.0°C
|
||||
----
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/azure/tool/FunctionCallWithFunctionWrapperIT.java[FunctionCallWithFunctionWrapperIT.java] test demo this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-azure-openai/src/test/java/org/springframework/ai/model/azure/openai/autoconfigure/tool/FunctionCallWithFunctionWrapperIT.java[FunctionCallWithFunctionWrapperIT.java] test demo this approach.
|
||||
|
||||
|
||||
=== Register/Call Functions with Prompt Options
|
||||
@@ -196,5 +196,5 @@ NOTE: The in-prompt registered functions are enabled by default for the duration
|
||||
|
||||
This approach allows to dynamically chose different functions to be called based on the user input.
|
||||
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/azure/tool/FunctionCallWithPromptFunctionIT.java[FunctionCallWithPromptFunctionIT.java] integration test provides a complete example of how to register a function with the `AzureOpenAiChatModel` and use it in a prompt request.
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-azure-openai/src/test/java/org/springframework/ai/model/azure/openai/autoconfigure/tool/FunctionCallWithPromptFunctionIT.java[FunctionCallWithPromptFunctionIT.java] integration test provides a complete example of how to register a function with the `AzureOpenAiChatModel` and use it in a prompt request.
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ public record Request(String location, Unit unit) {}
|
||||
|
||||
It is a best practice to annotate the request object with information such that the generates JSON schema of that function is as descriptive as possible to help the AI model pick the correct function to invoke.
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/minimax/FunctionCallbackWithPlainFunctionBeanIT.java[FunctionCallbackWithPlainFunctionBeanIT.java] demonstrates this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-minimax/src/test/java/org/springframework/ai/model/minimax/autoconfigure/FunctionCallbackWithPlainFunctionBeanIT.java[FunctionCallbackWithPlainFunctionBeanIT.java] demonstrates this approach.
|
||||
|
||||
|
||||
==== FunctionCallback Wrapper
|
||||
@@ -171,7 +171,7 @@ Here is the current weather for the requested cities:
|
||||
- Paris, France: 15.0°C
|
||||
----
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/minimax/tool/MiniMaxFunctionCallbackIT.java[MiniMaxFunctionCallbackIT.java] test demo this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-minimax/src/test/java/org/springframework/ai/model/minimax/autoconfigure/tool/MiniMaxFunctionCallbackIT.java[MiniMaxFunctionCallbackIT.java] test demo this approach.
|
||||
|
||||
|
||||
=== Register/Call Functions with Prompt Options
|
||||
@@ -199,4 +199,4 @@ NOTE: The in-prompt registered functions are enabled by default for the duration
|
||||
|
||||
This approach allows to dynamically chose different functions to be called based on the user input.
|
||||
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/minimax/FunctionCallbackInPromptIT.java[FunctionCallbackInPromptIT.java] integration test provides a complete example of how to register a function with the `MiniMaxChatModel` and use it in a prompt request.
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-minimax/src/test/java/org/springframework/ai/model/minimax/autoconfigure/FunctionCallbackInPromptIT.java[FunctionCallbackInPromptIT.java] integration test provides a complete example of how to register a function with the `MiniMaxChatModel` and use it in a prompt request.
|
||||
|
||||
@@ -110,9 +110,9 @@ public record Request(String location, Unit unit) {}
|
||||
|
||||
It is a best practice to annotate the request object with information such that the generated JSON schema of that function is as descriptive as possible to help the AI model pick the correct function to invoke.
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/mistralai/tool/PaymentStatusBeanIT.java[PaymentStatusBeanIT.java] demonstrates this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-mistral-ai/src/test/java/org/springframework/ai/model/mistralai/autoconfigure/tool/PaymentStatusBeanIT.java[PaymentStatusBeanIT.java] demonstrates this approach.
|
||||
|
||||
TIP: The Mistral AI link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/mistralai/tool/PaymentStatusBeanOpenAiIT.java[PaymentStatusBeanOpenAiIT] implements the same function using the OpenAI API.
|
||||
TIP: The Mistral AI link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-mistral-ai/src/test/java/org/springframework/ai/model/mistralai/autoconfigure/tool/PaymentStatusBeanOpenAiIT.java[PaymentStatusBeanOpenAiIT] implements the same function using the OpenAI API.
|
||||
Mistral AI is almost identical to OpenAI in this regard.
|
||||
|
||||
==== FunctionCallback Wrapper
|
||||
@@ -189,7 +189,7 @@ NOTE: The in-prompt registered functions are enabled by default for the duration
|
||||
|
||||
This approach allows to choose dynamically different functions to be called based on the user input.
|
||||
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/mistralai/tool/PaymentStatusPromptIT.java[PaymentStatusPromptIT.java] integration test provides a complete example of how to register a function with the `MistralAiChatModel` and use it in a prompt request.
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-mistral-ai/src/test/java/org/springframework/ai/model/mistralai/autoconfigure/tool/PaymentStatusPromptIT.java[PaymentStatusPromptIT.java] integration test provides a complete example of how to register a function with the `MistralAiChatModel` and use it in a prompt request.
|
||||
|
||||
== Appendices
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ public record Request(String location, Unit unit) {}
|
||||
|
||||
It is a best practice to annotate the request object with information such that the generates JSON schema of that function is as descriptive as possible to help the AI model pick the correct function to invoke.
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/moonshot/tool/FunctionCallbackWithPlainFunctionBeanIT.java[FunctionCallbackWithPlainFunctionBeanIT.java] demonstrates this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-moonshot/src/test/java/org/springframework/ai/model/moonshot/autoconfigure/tool/FunctionCallbackWithPlainFunctionBeanIT.java[FunctionCallbackWithPlainFunctionBeanIT.java] demonstrates this approach.
|
||||
|
||||
|
||||
==== FunctionCallback Wrapper
|
||||
@@ -171,7 +171,7 @@ Here is the current weather for the requested cities:
|
||||
- Paris, France: 15.0°C
|
||||
----
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/moonshot/tool/MoonshotFunctionCallbackIT.java[MoonshotFunctionCallbackIT.java] test demo this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-moonshot/src/test/java/org/springframework/ai/model/moonshot/autoconfigure/tool/MoonshotFunctionCallbackIT.java[MoonshotFunctionCallbackIT.java] test demo this approach.
|
||||
|
||||
|
||||
=== Register/Call Functions with Prompt Options
|
||||
@@ -199,4 +199,4 @@ NOTE: The in-prompt registered functions are enabled by default for the duration
|
||||
|
||||
This approach allows to dynamically chose different functions to be called based on the user input.
|
||||
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/moonshot/tool/FunctionCallbackInPromptIT.java[FunctionCallbackInPromptIT.java] integration test provides a complete example of how to register a function with the `MoonshotChatModel` and use it in a prompt request.
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-moonshot/src/test/java/org/springframework/ai/model/moonshot/autoconfigure/tool/FunctionCallbackInPromptIT.java[FunctionCallbackInPromptIT.java] integration test provides a complete example of how to register a function with the `MoonshotChatModel` and use it in a prompt request.
|
||||
|
||||
@@ -173,7 +173,7 @@ Here is the current weather for the requested cities:
|
||||
- Paris, France: 15.0°C
|
||||
----
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/ollama/tool/OllamaFunctionCallbackIT.java[OllamaFunctionCallbackIT.java] test demo this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-ollama/src/test/java/org/springframework/ai/model/ollama/autoconfigure/tool/OllamaFunctionCallbackIT.java[OllamaFunctionCallbackIT.java] test demo this approach.
|
||||
|
||||
=== Register/Call Functions with Prompt Options
|
||||
|
||||
@@ -200,7 +200,7 @@ NOTE: The in-prompt registered functions are enabled by default for the duration
|
||||
|
||||
This approach allows you to dynamically choose different functions to be called based on the user input.
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/ollama/tool/FunctionCallbackInPromptIT.java[FunctionCallbackInPromptIT.java] integration test provides a complete example of how to register a function with the `OllamaChatModel` and use it in a prompt request.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-ollama/src/test/java/org/springframework/ai/model/ollama/autoconfigure/tool/auto-configurations/models/spring-ai-autoconfigure-model-ollama/src/test/java/org/springframework/ai/model/ollama/autoconfigure/tool/FunctionCallbackInPromptIT.java[FunctionCallbackInPromptIT.java] integration test provides a complete example of how to register a function with the `OllamaChatModel` and use it in a prompt request.
|
||||
|
||||
== Appendices:
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ public record Request(String location, Unit unit) {}
|
||||
|
||||
It is a best practice to annotate the request object with information such that the generated JSON schema of that function is as descriptive as possible to help the AI model pick the correct function to invoke.
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/openai/tool/FunctionCallbackWithPlainFunctionBeanIT.java[FunctionCallbackWithPlainFunctionBeanIT.java] demonstrates this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-openai/src/test/java/org/springframework/ai/model/openai/autoconfigure/tool/FunctionCallbackWithPlainFunctionBeanIT.java[FunctionCallbackWithPlainFunctionBeanIT.java] demonstrates this approach.
|
||||
|
||||
==== FunctionCallback Wrapper
|
||||
|
||||
@@ -168,7 +168,7 @@ Here is the current weather for the requested cities:
|
||||
- Paris, France: 15.0°C
|
||||
----
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/openai/tool/OpenAiFunctionCallbackIT.java[OpenAiFunctionCallbackIT.java] test demo this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-openai/src/test/java/org/springframework/ai/model/openai/autoconfigure/tool/OpenAiFunctionCallbackIT.java[OpenAiFunctionCallbackIT.java] test demo this approach.
|
||||
|
||||
=== Register/Call Functions with Prompt Options
|
||||
|
||||
@@ -195,7 +195,7 @@ NOTE: The in-prompt registered functions are enabled by default for the duration
|
||||
|
||||
This approach allows to choose dynamically different functions to be called based on the user input.
|
||||
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/openai/tool/FunctionCallbackInPromptIT.java[FunctionCallbackInPromptIT.java] integration test provides a complete example of how to register a function with the `OpenAiChatModel` and use it in a prompt request.
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-openai/src/test/java/org/springframework/ai/model/openai/autoconfigure/tool/FunctionCallbackInPromptIT.java[FunctionCallbackInPromptIT.java] integration test provides a complete example of how to register a function with the `OpenAiChatModel` and use it in a prompt request.
|
||||
|
||||
|
||||
=== Tool Context Support
|
||||
|
||||
@@ -112,7 +112,7 @@ public record Request(String location, Unit unit) {}
|
||||
|
||||
It is a best practice to annotate the request object with information such that the generates JSON schema of that function is as descriptive as possible to help the AI model pick the correct function to invoke.
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/zhipuai/tool/FunctionCallbackWithPlainFunctionBeanIT.java[FunctionCallbackWithPlainFunctionBeanIT.java] demonstrates this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-zhipuai/src/test/java/org/springframework/ai/model/zhipuai/autoconfigure/tool/FunctionCallbackWithPlainFunctionBeanIT.java[FunctionCallbackWithPlainFunctionBeanIT.java] demonstrates this approach.
|
||||
|
||||
|
||||
==== FunctionCallback Wrapper
|
||||
@@ -171,7 +171,7 @@ Here is the current weather for the requested cities:
|
||||
- Paris, France: 15.0°C
|
||||
----
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/zhipuai/tool/ZhipuAiFunctionCallbackIT.java[ZhipuAiFunctionCallbackIT.java] test demo this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-zhipuai/src/test/java/org/springframework/ai/model/zhipuai/autoconfigure/tool/ZhipuAiFunctionCallbackIT.java[ZhipuAiFunctionCallbackIT.java] test demo this approach.
|
||||
|
||||
|
||||
=== Register/Call Functions with Prompt Options
|
||||
@@ -199,4 +199,4 @@ NOTE: The in-prompt registered functions are enabled by default for the duration
|
||||
|
||||
This approach allows to dynamically chose different functions to be called based on the user input.
|
||||
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/zhipuai/tool/FunctionCallbackInPromptIT.java[FunctionCallbackInPromptIT.java] integration test provides a complete example of how to register a function with the `ZhiPuAiChatModel` and use it in a prompt request.
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-zhipuai/src/test/java/org/springframework/ai/model/zhipuai/autoconfigure/tool/FunctionCallbackInPromptIT.java[FunctionCallbackInPromptIT.java] integration test provides a complete example of how to register a function with the `ZhiPuAiChatModel` and use it in a prompt request.
|
||||
|
||||
@@ -56,7 +56,7 @@ Maven::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -65,7 +65,7 @@ Gradle::
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
|
||||
}
|
||||
----
|
||||
======
|
||||
@@ -230,7 +230,7 @@ NOTE: Currently the Groq API doesn't support media content.
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-openai-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-openai` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the OpenAi chat model:
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-huggingface-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-huggingface</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -46,7 +46,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-huggingface-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-huggingface'
|
||||
}
|
||||
----
|
||||
|
||||
@@ -66,7 +66,7 @@ The prefix `spring.ai.huggingface` is the property prefix that lets you configur
|
||||
|
||||
== Sample Controller (Auto-configuration)
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-huggingface-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-huggingface` to your pom (or gradle) dependencies.
|
||||
|
||||
Add an `application.properties` file, under the `src/main/resources` directory, to enable and configure the Hugging Face chat model:
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-minimax-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-minimax</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -42,7 +42,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-minimax-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-minimax'
|
||||
}
|
||||
----
|
||||
|
||||
@@ -131,7 +131,7 @@ TIP: In addition to the model specific link:https://github.com/spring-projects/s
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-minimax-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-minimax` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the MiniMax chat model:
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-mistral-ai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-mistral-ai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -42,7 +42,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-mistral-ai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-mistral-ai'
|
||||
}
|
||||
----
|
||||
|
||||
@@ -205,7 +205,7 @@ Check the link:https://github.com/spring-projects/spring-ai/blob/main/models/spr
|
||||
|
||||
== Sample Controller (Auto-configuration)
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-mistral-ai-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-mistral-ai` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file under the `src/main/resources` directory to enable and configure the Mistral AI chat model:
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-moonshot-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-moonshot</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -41,7 +41,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-moonshot-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-moonshot'
|
||||
}
|
||||
----
|
||||
|
||||
@@ -130,7 +130,7 @@ TIP: In addition to the model specific link:https://github.com/spring-projects/s
|
||||
|
||||
== Sample Controller (Auto-configuration)
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-moonshot-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-moonshot` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the Moonshot Chat model:
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -38,7 +38,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
|
||||
}
|
||||
----
|
||||
|
||||
@@ -202,7 +202,7 @@ Read more about OpenAI link:https://docs.spring.io/spring-ai/reference/api/chat/
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-openai-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-openai` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the OpenAi chat model:
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-oci-genai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-oci-genai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -33,7 +33,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-oci-genai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-oci-genai'
|
||||
}
|
||||
----
|
||||
|
||||
@@ -111,7 +111,7 @@ ChatResponse response = chatModel.call(
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-oci-genai-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-oci-genai` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the OCI GenAI Cohere chat model:
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ Maven::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-ollama-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-ollama</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -52,7 +52,7 @@ Gradle::
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-ollama-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-ollama'
|
||||
}
|
||||
----
|
||||
======
|
||||
@@ -379,7 +379,7 @@ For production, you should pre-download the models to avoid delays: `ollama pull
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-ollama-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-ollama` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.yaml` file, under the `src/main/resources` directory, to enable and configure the Ollama chat model:
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ Maven::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -43,7 +43,7 @@ Gradle::
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
|
||||
}
|
||||
----
|
||||
======
|
||||
@@ -426,7 +426,7 @@ spring.ai.openai.chat.options.response-format.strict=true
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-openai-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-openai` to your pom (or gradle) dependencies.
|
||||
|
||||
Add an `application.properties` file under the `src/main/resources` directory to enable and configure the OpenAi chat model:
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ Maven::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -67,7 +67,7 @@ Gradle::
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
|
||||
}
|
||||
----
|
||||
======
|
||||
@@ -160,7 +160,7 @@ NOTE: Currently, the Perplexity API doesn't support media content.
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-openai-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-openai` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the OpenAi chat model:
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-qianfan-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-qianfan</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -44,7 +44,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-qianfan-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-qianfan'
|
||||
}
|
||||
----
|
||||
|
||||
@@ -134,7 +134,7 @@ TIP: In addition to the model specific link:https://github.com/spring-projects/s
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-qianfan-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-qianfan` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the QianFan Chat client:
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ Maven::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-vertex-ai-gemini-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-vertex-ai-gemini</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -42,7 +42,7 @@ Gradle::
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-vertex-ai-gemini-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-vertex-ai-gemini'
|
||||
}
|
||||
----
|
||||
======
|
||||
@@ -201,7 +201,7 @@ var response = this.chatModel.call(new Prompt(List.of(userMessage)));
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-vertex-ai-gemini-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-vertex-ai-gemini` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the VertexAi chat model:
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-watsonx-ai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-watsonx-ai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -30,7 +30,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-watsonx-ai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-watsonx-ai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-zhipuai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-zhipuai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -42,7 +42,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-zhipuai'
|
||||
}
|
||||
----
|
||||
|
||||
@@ -132,7 +132,7 @@ TIP: In addition to the model specific link:https://github.com/spring-projects/s
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-zhipuai-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-zhipuai` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the ZhiPuAi chat model:
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-azure-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-azure-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -76,7 +76,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-azure-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-azure-openai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@ To help with dependency management, Spring AI provides a BOM (bill of materials)
|
||||
|
||||
== Auto-configuration
|
||||
|
||||
Add the `spring-ai-bedrock-ai-spring-boot-starter` dependency to your project's Maven `pom.xml` file:
|
||||
Add the `spring-ai-starter-model-bedrock` dependency to your project's Maven `pom.xml` file:
|
||||
|
||||
[source,xml]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-bedrock-ai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-bedrock</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -33,7 +33,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,gradle]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-bedrock-ai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-bedrock'
|
||||
}
|
||||
----
|
||||
|
||||
@@ -102,7 +102,7 @@ EmbeddingResponse embeddingResponse = embeddingModel.call(
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-bedrock-ai-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-bedrock` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the Cohere Embedding model:
|
||||
|
||||
|
||||
@@ -25,13 +25,13 @@ To help with dependency management, Spring AI provides a BOM (bill of materials)
|
||||
|
||||
== Auto-configuration
|
||||
|
||||
Add the `spring-ai-bedrock-ai-spring-boot-starter` dependency to your project's Maven `pom.xml` file:
|
||||
Add the `spring-ai-starter-model-bedrock` dependency to your project's Maven `pom.xml` file:
|
||||
|
||||
[source,xml]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-bedrock-ai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-bedrock</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -40,7 +40,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,gradle]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-bedrock-ai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-bedrock'
|
||||
}
|
||||
----
|
||||
|
||||
@@ -101,7 +101,7 @@ EmbeddingResponse embeddingResponse = embeddingModel.call(
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-bedrock-ai-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-bedrock` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the Titan Embedding model:
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-minimax-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-minimax</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -42,7 +42,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-minimax-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-minimax'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-mistral-ai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-mistral-ai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -42,7 +42,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-mistral-ai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-mistral-ai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-oci-genai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-oci-genai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -31,7 +31,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-oci-genai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-oci-genai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ Maven::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-ollama-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-ollama</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -54,7 +54,7 @@ Gradle::
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-ollama-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-ollama'
|
||||
}
|
||||
----
|
||||
======
|
||||
|
||||
@@ -37,7 +37,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-transformers-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-transformers</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -46,7 +46,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-transformers-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-transformers'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -43,7 +43,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-postgresml-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-postgresml-embedding</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -35,7 +35,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-postgresml-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-postgresml-embedding'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-qianfan-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-qianfan</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -44,7 +44,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-qianfan-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-qianfan'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-vertex-ai-embedding-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-vertex-ai-embedding</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -53,7 +53,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-vertex-ai-embedding-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-vertex-ai-embedding'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-vertex-ai-embedding-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-vertex-ai-embedding</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -45,7 +45,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-vertex-ai-embedding-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-vertex-ai-embedding'
|
||||
}
|
||||
----
|
||||
|
||||
@@ -81,7 +81,7 @@ The prefix `spring.ai.vertex.ai.embedding.text` is the property prefix that lets
|
||||
|
||||
== Sample Controller
|
||||
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-vertex-ai-embedding-spring-boot-starter` to your pom (or gradle) dependencies.
|
||||
https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-starter-model-vertex-ai-embedding` to your pom (or gradle) dependencies.
|
||||
|
||||
Add a `application.properties` file, under the `src/main/resources` directory, to enable and configure the VertexAi chat model:
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ To enable it add the following dependency to your Maven `pom.xml` file:
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-watsonx-ai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-watsonx-ai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -41,7 +41,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-watsonx-ai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-watsonx-ai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-zhipuai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-zhipuai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -43,7 +43,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-zhipuai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ Here is the current weather for the requested cities:
|
||||
- Paris, France: 15.0°C
|
||||
----
|
||||
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/openai/tool/FunctionCallbackWithPlainFunctionBeanIT.java[FunctionCallbackWithPlainFunctionBeanIT.java] test demo this approach.
|
||||
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-openai/src/test/java/org/springframework/ai/model/openai/autoconfigure/tool/FunctionCallbackWithPlainFunctionBeanIT.java[FunctionCallbackWithPlainFunctionBeanIT.java] test demo this approach.
|
||||
|
||||
== Client-Side Registration
|
||||
|
||||
@@ -302,7 +302,7 @@ NOTE: The on the fly functions are enabled by default for the duration of this r
|
||||
|
||||
This approach allows to choose dynamically different functions to be called based on the user input.
|
||||
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/openai/tool/FunctionCallbackInPromptIT.java[FunctionCallbackInPromptIT.java] integration test provides a complete example of how to register a function with the `ChatClient` and use it in a prompt request.
|
||||
The https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-openai/src/test/java/org/springframework/ai/model/openai/autoconfigure/tool/FunctionCallbackInPromptIT.java[FunctionCallbackInPromptIT.java] integration test provides a complete example of how to register a function with the `ChatClient` and use it in a prompt request.
|
||||
|
||||
=== Method Invoking
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-azure-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-azure-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -68,7 +68,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-azure-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-azure-openai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -33,7 +33,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-qianfan-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-qianfan</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -42,7 +42,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-qianfan-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-qianfan'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-stability-ai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-stability-ai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -32,7 +32,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-stability-ai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-stability-ai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-zhipuai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-zhipuai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -40,7 +40,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-zhipuai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ The MCP Client Boot Starter provides:
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-mcp-client-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-mcp-client</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -27,7 +27,7 @@ The standard starter connects simultaneously to one or more MCP servers over `ST
|
||||
The SSE connection uses the HttpClient-based transport implementation.
|
||||
Each connection to an MCP server creates a new MCP client instance.
|
||||
You can choose either `SYNC` or `ASYNC` MCP clients (note: you cannot mix sync and async clients).
|
||||
For production deployment, we recommend using the WebFlux-based SSE connection with the `spring-ai-mcp-client-webflux-spring-boot-starter`.
|
||||
For production deployment, we recommend using the WebFlux-based SSE connection with the `spring-ai-starter-mcp-client-webflux`.
|
||||
|
||||
=== WebFlux Client
|
||||
|
||||
@@ -37,7 +37,7 @@ The WebFlux starter provides similar functionality to the standard starter but u
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-mcp-client-webflux-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-mcp-client-webflux</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -296,8 +296,8 @@ The MCP client auto-configuration automatically detects and applies any customiz
|
||||
|
||||
The auto-configuration supports multiple transport types:
|
||||
|
||||
* Standard I/O (Stdio) (activated by the `spring-ai-mcp-client-spring-boot-starter`)
|
||||
* SSE HTTP (activated by the `spring-ai-mcp-client-spring-boot-starter`)
|
||||
* Standard I/O (Stdio) (activated by the `spring-ai-starter-mcp-client`)
|
||||
* SSE HTTP (activated by the `spring-ai-starter-mcp-client`)
|
||||
* SSE WebFlux (activated by the `spring-ai-starter-mcp-client-webflux`)
|
||||
|
||||
=== Integration with Spring AI
|
||||
@@ -364,8 +364,8 @@ ToolCallback[] toolCallbacks = toolCallbackProvider.getToolCallbacks();
|
||||
== Example Applications
|
||||
|
||||
- link:https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/web-search/brave-chatbot[Brave Wet Search Chatbot] - A chatbot that uses the Model Context Protocol to interact with a web search server.
|
||||
- link:https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/client-starter/starter-default-client[Default MCP Client Starter] - A simple example of using the the default `spring-ai-mcp-client-spring-boot-starter` MCP Client Boot Starter.
|
||||
- link:https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/client-starter/starter-webflux-client[WebFlux MCP Client Starter] - A simple example of using the `spring-ai-mcp-client-webflux-spring-boot-starter` the MCP Client Boot Starter.
|
||||
- link:https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/client-starter/starter-default-client[Default MCP Client Starter] - A simple example of using the the default `spring-ai-starter-mcp-client` MCP Client Boot Starter.
|
||||
- link:https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/client-starter/starter-webflux-client[WebFlux MCP Client Starter] - A simple example of using the `spring-ai-starter-mcp-client-webflux` the MCP Client Boot Starter.
|
||||
|
||||
== Additional Resources
|
||||
|
||||
|
||||
@@ -76,13 +76,13 @@ For simplified setup using Spring Boot, use the MCP Boot Starters described belo
|
||||
Spring AI provides MCP integration through the following Spring Boot starters:
|
||||
|
||||
=== link:mcp-client-boot-starter-docs.html[Client Starters]
|
||||
* `spring-ai-mcp-client-spring-boot-starter` - Core starter providing STDIO and HTTP-based SSE support
|
||||
* `spring-ai-mcp-client-webflux-spring-boot-starter` - WebFlux-based SSE transport implementation
|
||||
* `spring-ai-starter-mcp-client` - Core starter providing STDIO and HTTP-based SSE support
|
||||
* `spring-ai-starter-mcp-client-webflux` - WebFlux-based SSE transport implementation
|
||||
|
||||
=== link:mcp-server-boot-starter-docs.html[Server Starters]
|
||||
* `spring-ai-mcp-server-spring-boot-starter` - Core server with STDIO transport support
|
||||
* `spring-ai-mcp-server-webmvc-spring-boot-starter` - Spring MVC-based SSE transport implementation
|
||||
* `spring-ai-mcp-server-webflux-spring-boot-starter` - WebFlux-based SSE transport implementation
|
||||
* `spring-ai-starter-mcp-server` - Core server with STDIO transport support
|
||||
* `spring-ai-starter-mcp-server-webmvc` - Spring MVC-based SSE transport implementation
|
||||
* `spring-ai-starter-mcp-server-webflux` - WebFlux-based SSE transport implementation
|
||||
|
||||
== Additional Resources
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Full MCP Server features support with `STDIO` server transport.
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-mcp-server-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-mcp-server</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -44,7 +44,7 @@ Full MCP Server features support with `SSE` (Server-Sent Events) server transpor
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-mcp-server-webmvc-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-mcp-server-webmvc</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -63,7 +63,7 @@ Full MCP Server features support with `SSE` (Server-Sent Events) server transpor
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-mcp-server-webflux-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-mcp-server-webflux</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -108,9 +108,9 @@ This server type automatically sets up asynchronous tool registrations with buil
|
||||
|
||||
The MCP Server supports three transport mechanisms, each with its dedicated starter:
|
||||
|
||||
* Standard Input/Output (STDIO) - `spring-ai-mcp-server-spring-boot-starter`
|
||||
* Spring MVC (Server-Sent Events) - `spring-ai-mcp-server-webmvc-spring-boot-starter`
|
||||
* Spring WebFlux (Reactive SSE) - `spring-ai-mcp-server-webflux-spring-boot-starter`
|
||||
* Standard Input/Output (STDIO) - `spring-ai-starter-mcp-server`
|
||||
* Spring MVC (Server-Sent Events) - `spring-ai-starter-mcp-server-webmvc`
|
||||
* Spring WebFlux (Reactive SSE) - `spring-ai-starter-mcp-server-webflux`
|
||||
|
||||
== Features and Capabilities
|
||||
|
||||
@@ -225,7 +225,7 @@ public Consumer<List<McpSchema.Root>> rootsChangeConsumer() {
|
||||
=== Standard STDIO Server Configuration
|
||||
[source,yaml]
|
||||
----
|
||||
# Using spring-ai-mcp-server-spring-boot-starter
|
||||
# Using spring-ai-starter-mcp-server
|
||||
spring:
|
||||
ai:
|
||||
mcp:
|
||||
@@ -238,7 +238,7 @@ spring:
|
||||
=== WebMVC Server Configuration
|
||||
[source,yaml]
|
||||
----
|
||||
# Using spring-ai-mcp-server-webmvc-spring-boot-starter
|
||||
# Using spring-ai-starter-mcp-server-webmvc
|
||||
spring:
|
||||
ai:
|
||||
mcp:
|
||||
@@ -252,7 +252,7 @@ spring:
|
||||
=== WebFlux Server Configuration
|
||||
[source,yaml]
|
||||
----
|
||||
# Using spring-ai-mcp-server-webflux-spring-boot-starter
|
||||
# Using spring-ai-starter-mcp-server-webflux
|
||||
spring:
|
||||
ai:
|
||||
mcp:
|
||||
|
||||
@@ -20,7 +20,7 @@ To enable it add the following dependency to your project's Maven `pom.xml` file
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -29,7 +29,7 @@ or to your Gradle `build.gradle` build file:
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ OpenAI Embedding::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -64,7 +64,7 @@ Azure AI Embedding::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-azure-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-azure-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -74,7 +74,7 @@ Local Sentence Transformers Embedding::
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-transformers-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-transformers</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
======
|
||||
|
||||
@@ -198,7 +198,7 @@ Add these dependencies to your project:
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ You may set the property `spring-ai-version` as `<spring-ai-version>1.0.0-SNAPSH
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -49,7 +49,7 @@ For example, to use the xref:api/embeddings/openai-embeddings.adoc[OpenAI Embedd
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ For example to use the xref:api/embeddings/openai-embeddings.adoc[OpenAI Embeddi
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -47,7 +47,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ For example, to use the xref:api/embeddings/openai-embeddings.adoc[OpenAI Embedd
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -77,7 +77,7 @@ or to your Gradle `build.gradle` build file.
|
||||
[source,groovy]
|
||||
----
|
||||
dependencies {
|
||||
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
|
||||
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ Add these dependencies to your project:
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
|
||||
Reference in New Issue
Block a user