From 72011baf50b5f96b2b2457d9762ace7aa84656b6 Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Thu, 22 Aug 2024 13:09:45 -0400 Subject: [PATCH] Adding ref docs for cloud bindings --- .../src/main/antora/modules/ROOT/nav.adoc | 2 +- .../ROOT/pages/api/cloud-bindings.adoc | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 spring-ai-docs/src/main/antora/modules/ROOT/pages/api/cloud-bindings.adoc diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/nav.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/nav.adoc index 669381de4..681de5464 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/nav.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/nav.adoc @@ -99,7 +99,7 @@ * Service Connections ** xref:api/docker-compose.adoc[Docker Compose] ** xref:api/testcontainers.adoc[Testcontainers] - +** xref:api/cloud-bindings.adoc[Cloud Bindings] * xref:contribution-guidelines.adoc[Contribution Guidelines] diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/cloud-bindings.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/cloud-bindings.adoc new file mode 100644 index 000000000..71c98c10d --- /dev/null +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/cloud-bindings.adoc @@ -0,0 +1,53 @@ +[[cloud-bindings]] += Cloud Bindings + +Spring AI provides support for cloud bindings based on the foundations in https://github.com/spring-cloud/spring-cloud-bindings[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. + +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. + +To enable cloud binding support, include the following dependency in the application. + + +[source,xml] +---- + + org.springframework.ai + spring-ai-spring-cloud-bindings + +---- + +or to your Gradle `build.gradle` build file. + +[source,groovy] +---- +dependencies { + implementation 'org.springframework.ai:spring-ai-spring-cloud-bindings' +} +---- + +TIP: Refer to the xref:getting-started.adoc#dependency-management[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: + +[cols="|,|"] +|==== +| Service Type | Binding Type | Source Properties | Target Properties +| `Chroma Vecor Store` +| `chroma` | `uri`, `username`, `passwor` | `spring.ai.vectorstore.chroma.client.host`, `spring.ai.vectorstore.chroma.client.port`, `spring.ai.vectorstore.chroma.client.username`, `spring.ai.vectorstore.chroma.client.host.password` + +| `Ollama` +| `ollama` | `uri` | `spring.ai.ollama.base-url` + +| `OpenAi` +| `openai` | `api-key`, `uri` | `spring.ai.openai.api-key`, `spring.ai.openai.base-url` + +| `Weaviate` +| `weaviate` | `uri`, `api-key` | `spring.ai.vectorstore.weaviate.scheme`, `spring.ai.vectorstore.weaviate.host`, `spring.ai.vectorstore.weaviate.api-key` +|====