Cloud Bindings

Spring AI provides support for cloud bindings based on the foundations in spring-cloud-bindings. This allows applications to specify a binding type for a provider and then express properties using a generic format. The spring-ai cloud bindings will process these properties and bind them to spring-ai native properties.spring-doc.cn

For example, when using OpenAi, the binding type is openai. Using the property spring.ai.cloud.bindings.openai.enabled, the binding processor can be enabled or disabled. By default, when specifying a binding type, this property will be enabled. Configuration for api-key, uri, username, password, etc. can be specified and spring-ai will map them to the corresponding properties in the supported system.spring-doc.cn

To enable cloud binding support, include the following dependency in the application.spring-doc.cn

<dependency>
   <groupId>org.springframework.ai</groupId>
   <artifactId>spring-ai-spring-cloud-bindings</artifactId>
</dependency>

or to your Gradle build.gradle build file.spring-doc.cn

dependencies {
    implementation 'org.springframework.ai:spring-ai-spring-cloud-bindings'
}
Refer to the Dependency Management section to add the Spring AI BOM to your build file.

Available Cloud Bindings

The following are the components for which the cloud binding support is currently available in the spring-ai-spring-clou-bindings module:spring-doc.cn

Service Typespring-doc.cn

Binding Typespring-doc.cn

Source Propertiesspring-doc.cn

Target Propertiesspring-doc.cn

Chroma Vecor Storespring-doc.cn

chromaspring-doc.cn

uri, username, passworspring-doc.cn

spring.ai.vectorstore.chroma.client.host, spring.ai.vectorstore.chroma.client.port, spring.ai.vectorstore.chroma.client.username, spring.ai.vectorstore.chroma.client.host.passwordspring-doc.cn

Mistral AIspring-doc.cn

mistralaispring-doc.cn

api-key, urispring-doc.cn

spring.ai.mistralai.api-key, spring.ai.mistralai.base-urlspring-doc.cn

Ollamaspring-doc.cn

ollamaspring-doc.cn

urispring-doc.cn

spring.ai.ollama.base-urlspring-doc.cn

OpenAispring-doc.cn

openaispring-doc.cn

api-key, urispring-doc.cn

spring.ai.openai.api-key, spring.ai.openai.base-urlspring-doc.cn

Weaviatespring-doc.cn

weaviatespring-doc.cn

uri, api-keyspring-doc.cn

spring.ai.vectorstore.weaviate.scheme, spring.ai.vectorstore.weaviate.host, spring.ai.vectorstore.weaviate.api-keyspring-doc.cn

Tanzu GenAIspring-doc.cn

genaispring-doc.cn

uri, api-key, model-capabilities (chat and embedding), model-namespring-doc.cn

spring.ai.openai.chat.base-url, , spring.ai.openai.chat.api-key`, spring.ai.openai.chat.options.model, spring.ai.openai.embedding.base-url, , spring.ai.openai.embedding.api-key`, spring.ai.openai.embedding.options.modelspring-doc.cn