From 9c19dc1665f9b04d0c7770a6829ad852b700bf45 Mon Sep 17 00:00:00 2001 From: Christian Tzolov Date: Sat, 16 Mar 2024 11:26:12 +0100 Subject: [PATCH] Improve Antora documentation layout - tename /api/clients/ into /api/chat - move the the image from /api/clients to /api - fix the layout inside the chat and embeddings docs. Moving the runtime options and sample controllers at top level. - adjust all affected links. --- models/spring-ai-azure-openai/README.md | 2 +- models/spring-ai-bedrock/README.md | 8 ++--- models/spring-ai-huggingface/README.md | 2 +- models/spring-ai-ollama/README.md | 2 +- models/spring-ai-openai/README.md | 4 +-- models/spring-ai-vertex-ai-palm2/README.md | 2 +- .../src/main/antora/modules/ROOT/nav.adoc | 36 +++++++++---------- .../modules/ROOT/pages/api/bedrock.adoc | 10 +++--- .../{clients => chat}/azure-openai-chat.adoc | 10 +++--- .../bedrock/bedrock-anthropic.adoc | 4 +-- .../bedrock/bedrock-cohere.adoc | 4 +-- .../bedrock/bedrock-llama2.adoc | 4 +-- .../bedrock/bedrock-titan.adoc | 6 ++-- .../azure-open-ai-chat-functions.adoc | 0 .../functions/mistralai-chat-functions.adoc | 0 .../functions/openai-chat-functions.adoc | 0 .../vertexai-gemini-chat-functions.adoc | 0 .../{clients => chat}/google-vertexai.adoc | 4 +-- .../api/{clients => chat}/huggingface.adoc | 0 .../api/{clients => chat}/mistralai-chat.adoc | 4 +-- .../api/{clients => chat}/ollama-chat.adoc | 6 ++-- .../api/{clients => chat}/openai-chat.adoc | 10 +++--- .../vertexai-gemini-chat.adoc | 2 +- .../vertexai-palm2-chat.adoc | 4 +-- .../modules/ROOT/pages/api/chatclient.adoc | 22 ++++++------ .../embeddings/azure-openai-embeddings.adoc | 4 +-- .../embeddings/bedrock-cohere-embedding.adoc | 4 +-- .../embeddings/bedrock-titan-embedding.adoc | 2 +- .../api/embeddings/mistralai-embeddings.adoc | 6 ++-- .../api/embeddings/ollama-embeddings.adoc | 6 ++-- .../api/embeddings/openai-embeddings.adoc | 6 ++-- .../api/embeddings/postgresml-embeddings.adoc | 4 +-- .../api/embeddings/vertexai-embeddings.adoc | 4 +-- .../modules/ROOT/pages/api/functions.adoc | 8 ++--- .../api/{clients => }/image/openai-image.adoc | 0 .../image/stabilityai-image.adoc | 2 +- .../modules/ROOT/pages/api/imageclient.adoc | 4 +-- .../ROOT/pages/contribution-guidelines.adoc | 4 +-- .../modules/ROOT/pages/getting-started.adoc | 28 +++++++-------- .../modules/ROOT/pages/upgrade-notes.adoc | 2 +- 40 files changed, 115 insertions(+), 115 deletions(-) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/azure-openai-chat.adoc (97%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/bedrock/bedrock-anthropic.adoc (99%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/bedrock/bedrock-cohere.adoc (99%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/bedrock/bedrock-llama2.adoc (99%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/bedrock/bedrock-titan.adoc (98%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/functions/azure-open-ai-chat-functions.adoc (100%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/functions/mistralai-chat-functions.adoc (100%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/functions/openai-chat-functions.adoc (100%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/functions/vertexai-gemini-chat-functions.adoc (100%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/google-vertexai.adoc (75%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/huggingface.adoc (100%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/mistralai-chat.adoc (99%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/ollama-chat.adoc (99%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/openai-chat.adoc (98%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/vertexai-gemini-chat.adoc (98%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => chat}/vertexai-palm2-chat.adoc (99%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => }/image/openai-image.adoc (100%) rename spring-ai-docs/src/main/antora/modules/ROOT/pages/api/{clients => }/image/stabilityai-image.adoc (99%) diff --git a/models/spring-ai-azure-openai/README.md b/models/spring-ai-azure-openai/README.md index af87a28e2..e38143ee7 100644 --- a/models/spring-ai-azure-openai/README.md +++ b/models/spring-ai-azure-openai/README.md @@ -1,3 +1,3 @@ -[Azure OpenAI Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/azure-openai-chat.html) +[Azure OpenAI Chat Documentation](https://docs.spring.io/spring-ai/reference/api/chat/azure-openai-chat.html) [Azure OpenAI Embedding Documentation](https://docs.spring.io/spring-ai/reference/api/embeddings/azure-openai-embeddings.html) diff --git a/models/spring-ai-bedrock/README.md b/models/spring-ai-bedrock/README.md index ec5706336..ccc1698fd 100644 --- a/models/spring-ai-bedrock/README.md +++ b/models/spring-ai-bedrock/README.md @@ -1,10 +1,10 @@ [Amazon Bedrock Overview](https://docs.spring.io/spring-ai/reference/api/bedrock.html) -- [Anthropic Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/bedrock/bedrock-anthropic.html) -- [Cohere Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/bedrock/bedrock-cohere.html) +- [Anthropic Chat Documentation](https://docs.spring.io/spring-ai/reference/api/chat/bedrock/bedrock-anthropic.html) +- [Cohere Chat Documentation](https://docs.spring.io/spring-ai/reference/api/chat/bedrock/bedrock-cohere.html) - [Cohere Embedding Documentation](https://docs.spring.io/spring-ai/reference/api/embeddings/bedrock-cohere-embedding.html) -- [Llama2 Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/bedrock/bedrock-llama2.html) -- [Titan Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/bedrock/bedrock-titan.html) +- [Llama2 Chat Documentation](https://docs.spring.io/spring-ai/reference/api/chat/bedrock/bedrock-llama2.html) +- [Titan Chat Documentation](https://docs.spring.io/spring-ai/reference/api/chat/bedrock/bedrock-titan.html) - [Titan Embedding Documentation](https://docs.spring.io/spring-ai/reference/api/embeddings/bedrock-titan-embedding.html) NOTE: There is not yet an implementation for Jurassic, but you can use the lower level client [Ai21Jurassic2ChatBedrockApi.java](https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/jurassic2/api/Ai21Jurassic2ChatBedrockApi.java) in the meantime. See [Issue 343](https://github.com/spring-projects/spring-ai/issues/343) \ No newline at end of file diff --git a/models/spring-ai-huggingface/README.md b/models/spring-ai-huggingface/README.md index 720a25050..cc64e74b6 100644 --- a/models/spring-ai-huggingface/README.md +++ b/models/spring-ai-huggingface/README.md @@ -1,2 +1,2 @@ -[Huggingface Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/huggingface.html) +[Huggingface Chat Documentation](https://docs.spring.io/spring-ai/reference/api/chat/huggingface.html) diff --git a/models/spring-ai-ollama/README.md b/models/spring-ai-ollama/README.md index 2eb9d58a6..0e9c348e3 100644 --- a/models/spring-ai-ollama/README.md +++ b/models/spring-ai-ollama/README.md @@ -1,3 +1,3 @@ -[Ollama Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/ollama-chat.html) +[Ollama Chat Documentation](https://docs.spring.io/spring-ai/reference/api/chat/ollama-chat.html) [Ollama Embedding Documentation](https://docs.spring.io/spring-ai/reference/api/embeddings/ollama-embeddings.html) diff --git a/models/spring-ai-openai/README.md b/models/spring-ai-openai/README.md index a45db418a..f2795e28e 100644 --- a/models/spring-ai-openai/README.md +++ b/models/spring-ai-openai/README.md @@ -1,7 +1,7 @@ -[OpenAI Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/openai-chat.html) +[OpenAI Chat Documentation](https://docs.spring.io/spring-ai/reference/api/chat/openai-chat.html) [OpenAI Embedding Documentation](https://docs.spring.io/spring-ai/reference/api/embeddings/openai-embeddings.html) -[OpenAI Image Generation](https://docs.spring.io/spring-ai/reference/api/clients/image/openai-image.html) +[OpenAI Image Generation](https://docs.spring.io/spring-ai/reference/api/image/openai-image.html) [OpenAI Transcription Generation](TODO) \ No newline at end of file diff --git a/models/spring-ai-vertex-ai-palm2/README.md b/models/spring-ai-vertex-ai-palm2/README.md index 33a478048..ec6eaf6f8 100644 --- a/models/spring-ai-vertex-ai-palm2/README.md +++ b/models/spring-ai-vertex-ai-palm2/README.md @@ -1,4 +1,4 @@ -[VertexAI PaLM2 Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/vertexai-chat.html) +[VertexAI PaLM2 Chat Documentation](https://docs.spring.io/spring-ai/reference/api/chat/vertexai-chat.html) [VertexAI PaLM2 Embedding Documentation](https://docs.spring.io/spring-ai/reference/api/embeddings/vertexai-embeddings.html) 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 7fa84af40..8923d44be 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/nav.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/nav.adoc @@ -3,23 +3,23 @@ * xref:getting-started.adoc[Getting Started] * xref:api/index.adoc[] ** xref:api/chatclient.adoc[] -*** xref:api/clients/openai-chat.adoc[OpenAI] -**** xref:api/clients/functions/openai-chat-functions.adoc[Function Calling] -*** xref:api/clients/ollama-chat.adoc[Ollama] -*** xref:api/clients/azure-openai-chat.adoc[Azure OpenAI] -**** xref:api/clients/functions/azure-open-ai-chat-functions.adoc[Function Calling] +*** xref:api/chat/openai-chat.adoc[OpenAI] +**** xref:api/chat/functions/openai-chat-functions.adoc[Function Calling] +*** xref:api/chat/ollama-chat.adoc[Ollama] +*** xref:api/chat/azure-openai-chat.adoc[Azure OpenAI] +**** xref:api/chat/functions/azure-open-ai-chat-functions.adoc[Function Calling] *** xref:api/bedrock-chat.adoc[Amazon Bedrock] -**** xref:api/clients/bedrock/bedrock-anthropic.adoc[Anthropic] -**** xref:api/clients/bedrock/bedrock-llama2.adoc[Llama2] -**** xref:api/clients/bedrock/bedrock-cohere.adoc[Cohere] -**** xref:api/clients/bedrock/bedrock-titan.adoc[Titan] -*** xref:api/clients/huggingface.adoc[HuggingFace] -*** xref:api/clients/google-vertexai.adoc[Google VertexAI] -**** xref:api/clients/vertexai-palm2-chat.adoc[VertexAI PaLM2 ] -**** xref:api/clients/vertexai-gemini-chat.adoc[VertexAI Gemini] -***** xref:api/clients/functions/vertexai-gemini-chat-functions.adoc[Function Calling] -*** xref:api/clients/mistralai-chat.adoc[Mistral AI] -**** xref:api/clients/functions/mistralai-chat-functions.adoc[Function Calling] +**** xref:api/chat/bedrock/bedrock-anthropic.adoc[Anthropic] +**** xref:api/chat/bedrock/bedrock-llama2.adoc[Llama2] +**** xref:api/chat/bedrock/bedrock-cohere.adoc[Cohere] +**** xref:api/chat/bedrock/bedrock-titan.adoc[Titan] +*** xref:api/chat/huggingface.adoc[HuggingFace] +*** xref:api/chat/google-vertexai.adoc[Google VertexAI] +**** xref:api/chat/vertexai-palm2-chat.adoc[VertexAI PaLM2 ] +**** xref:api/chat/vertexai-gemini-chat.adoc[VertexAI Gemini] +***** xref:api/chat/functions/vertexai-gemini-chat-functions.adoc[Function Calling] +*** xref:api/chat/mistralai-chat.adoc[Mistral AI] +**** xref:api/chat/functions/mistralai-chat-functions.adoc[Function Calling] ** xref:api/embeddings.adoc[] *** xref:api/embeddings/openai-embeddings.adoc[OpenAI] *** xref:api/embeddings/ollama-embeddings.adoc[Ollama] @@ -32,8 +32,8 @@ *** xref:api/embeddings/onnx.adoc[Transformers (ONNX)] *** xref:api/embeddings/mistralai-embeddings.adoc[Mistral AI] ** xref:api/imageclient.adoc[] -*** xref:api/clients/image/openai-image.adoc[OpenAI] -*** xref:api/clients/image/stabilityai-image.adoc[Stability] +*** xref:api/image/openai-image.adoc[OpenAI] +*** xref:api/image/stabilityai-image.adoc[Stability] ** xref:api/transcriptions.adoc[] *** xref:api/transcriptions/openai-transcriptions.adoc[OpenAI] ** xref:api/vectordbs.adoc[] diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/bedrock.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/bedrock.adoc index 47fdd4471..5b273bb33 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/bedrock.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/bedrock.adoc @@ -84,11 +84,11 @@ Next, you can use the `spring.ai.bedrock...*` properties For more information, refer to the documentation below for each supported model. -* xref:api/clients/bedrock/bedrock-anthropic.adoc[Spring AI Bedrock Anthropic Chat]: `spring.ai.bedrock.anthropic.chat.enabled=true` -* xref:api/clients/bedrock/bedrock-llama2.adoc[Spring AI Bedrock Llama2 Chat]: `spring.ai.bedrock.llama2.chat.enabled=true` -* xref:api/clients/bedrock/bedrock-cohere.adoc[Spring AI Bedrock Cohere Chat]: `spring.ai.bedrock.cohere.chat.enabled=true` +* xref:api/chat/bedrock/bedrock-anthropic.adoc[Spring AI Bedrock Anthropic Chat]: `spring.ai.bedrock.anthropic.chat.enabled=true` +* xref:api/chat/bedrock/bedrock-llama2.adoc[Spring AI Bedrock Llama2 Chat]: `spring.ai.bedrock.llama2.chat.enabled=true` +* xref:api/chat/bedrock/bedrock-cohere.adoc[Spring AI Bedrock Cohere Chat]: `spring.ai.bedrock.cohere.chat.enabled=true` * xref:api/embeddings/bedrock-cohere-embedding.adoc[Spring AI Bedrock Cohere Embeddings]: `spring.ai.bedrock.cohere.embedding.enabled=true` -* xref:api/clients/bedrock/bedrock-titan.adoc[Spring AI Bedrock Titan Chat]: `spring.ai.bedrock.titan.chat.enabled=true` +* xref:api/chat/bedrock/bedrock-titan.adoc[Spring AI Bedrock Titan Chat]: `spring.ai.bedrock.titan.chat.enabled=true` * xref:api/embeddings/bedrock-titan-embedding.adoc[Spring AI Bedrock Titan Embeddings]: `spring.ai.bedrock.titan.embedding.enabled=true` -// * xref:api/clients/bedrock/bedrock-jurassic2-chat.adoc[(WIP)Spring AI Bedrock Jurassic Chat]: `spring.ai.bedrock.jurassic2.chat.enabled=true` +// * xref:api/chat/bedrock/bedrock-jurassic2-chat.adoc[(WIP)Spring AI Bedrock Jurassic Chat]: `spring.ai.bedrock.jurassic2.chat.enabled=true` diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/azure-openai-chat.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/azure-openai-chat.adoc similarity index 97% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/azure-openai-chat.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/azure-openai-chat.adoc index 762628efd..7c02eb932 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/azure-openai-chat.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/azure-openai-chat.adoc @@ -111,7 +111,7 @@ Deployments model name to provide as part of this completions request. TIP: All properties prefixed with `spring.ai.azure.openai.chat.options` can be overridden at runtime by adding a request specific <> to the `Prompt` call. -=== Chat Options [[chat-options]] +== Runtime Options [[chat-options]] The link:https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-azure-openai/src/main/java/org/springframework/ai/azure/openai/AzureOpenAiChatOptions.java[AzureOpenAiChatOptions.java] provides model configurations, such as the model to use, the temperature, the frequency penalty, etc. @@ -135,13 +135,13 @@ ChatResponse response = chatClient.call( TIP: In addition to the model specific link:https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-azure-openai/src/main/java/org/springframework/ai/azure/openai/AzureOpenAiChatOptions.java[AzureOpenAiChatOptions.java] you can use a portable https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptions.java[ChatOptions] instance, created with the https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptionsBuilder.java[ChatOptionsBuilder#builder()]. -=== Function Calling +== Function Calling You can register custom Java functions with the AzureOpenAiChatClient and have the model intelligently choose to output a JSON object containing arguments to call one or many of the registered functions. This is a powerful technique to connect the LLM capabilities with external tools and APIs. -Read more about xref:api/clients/functions/azure-open-ai-chat-functions.adoc[Azure OpenAI Function Calling]. +Read more about xref:api/chat/functions/azure-open-ai-chat-functions.adoc[Azure OpenAI Function Calling]. -=== Sample Controller (Auto-configuration) +== 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. @@ -210,7 +210,7 @@ dependencies { TIP: Refer to the xref:getting-started.adoc#dependency-management[Dependency Management] section to add the Spring AI BOM to your build file. -TIP: The `spring-ai-azure-openai` dependency also provide the access to the `AzureOpenAiChatClient`. For more information about the `AzureOpenAiChatClient` refer to the link:../clients/azure-openai-chat.html[Azure OpenAI Chat] section. +TIP: The `spring-ai-azure-openai` dependency also provide the access to the `AzureOpenAiChatClient`. For more information about the `AzureOpenAiChatClient` refer to the link:../chat/azure-openai-chat.html[Azure OpenAI Chat] section. Next, create an `AzureOpenAiChatClient` instance and use it to generate text responses: diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/bedrock/bedrock-anthropic.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock/bedrock-anthropic.adoc similarity index 99% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/bedrock/bedrock-anthropic.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock/bedrock-anthropic.adoc index 3a05998fc..192eb5976 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/bedrock/bedrock-anthropic.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock/bedrock-anthropic.adoc @@ -89,7 +89,7 @@ Model ID values can also be found in the https://docs.aws.amazon.com/bedrock/lat TIP: All properties prefixed with `spring.ai.bedrock.anthropic.chat.options` can be overridden at runtime by adding a request specific <> to the `Prompt` call. -=== Chat Options [[chat-options]] +== Runtime Options [[chat-options]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/anthropic/AnthropicChatOptions.java[AnthropicChatOptions.java] provides model configurations, such as temperature, topK, topP, etc. @@ -111,7 +111,7 @@ ChatResponse response = chatClient.call( TIP: In addition to the model specific https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/anthropic/AnthropicChatOptions.java[AnthropicChatOptions] you can use a portable https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptions.java[ChatOptions] instance, created with the https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptionsBuilder.java[ChatOptionsBuilder#builder()]. -=== Sample Controller (Auto-configuration) +== 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. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/bedrock/bedrock-cohere.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock/bedrock-cohere.adoc similarity index 99% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/bedrock/bedrock-cohere.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock/bedrock-cohere.adoc index 98b106e72..c24d251c7 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/bedrock/bedrock-cohere.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock/bedrock-cohere.adoc @@ -88,7 +88,7 @@ Model ID values can also be found in the https://docs.aws.amazon.com/bedrock/lat TIP: All properties prefixed with `spring.ai.bedrock.cohere.chat.options` can be overridden at runtime by adding a request specific <> to the `Prompt` call. -=== Chat Options [[chat-options]] +== Runtime Options [[chat-options]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/BedrockCohereChatOptions.java[BedrockCohereChatOptions.java] provides model configurations, such as temperature, topK, topP, etc. @@ -110,7 +110,7 @@ ChatResponse response = chatClient.call( TIP: In addition to the model specific https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/BedrockCohereChatOptions.java[BedrockCohereChatOptions] you can use a portable https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptions.java[ChatOptions] instance, created with the https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptionsBuilder.java[ChatOptionsBuilder#builder()]. -=== Sample Controller (Auto-configuration) +== 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. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/bedrock/bedrock-llama2.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock/bedrock-llama2.adoc similarity index 99% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/bedrock/bedrock-llama2.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock/bedrock-llama2.adoc index 25f4823db..8b317cd4e 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/bedrock/bedrock-llama2.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock/bedrock-llama2.adoc @@ -86,7 +86,7 @@ Model ID values can also be found in the https://docs.aws.amazon.com/bedrock/lat TIP: All properties prefixed with `spring.ai.bedrock.llama2.chat.options` can be overridden at runtime by adding a request specific <> to the `Prompt` call. -=== Chat Options [[chat-options]] +== Runtime Options [[chat-options]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/llama2/BedrockLlama2ChatOptions.java[BedrockLlama2ChatOptions.java] provides model configurations, such as temperature, topK, topP, etc. @@ -108,7 +108,7 @@ ChatResponse response = chatClient.call( TIP: In addition to the model specific https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/llama2/BedrockLlama2ChatOptions.java[BedrockLlama2ChatOptions] you can use a portable https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptions.java[ChatOptions] instance, created with the https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptionsBuilder.java[ChatOptionsBuilder#builder()]. -=== Sample Controller (Auto-configuration) +== 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. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/bedrock/bedrock-titan.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock/bedrock-titan.adoc similarity index 98% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/bedrock/bedrock-titan.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock/bedrock-titan.adoc index ecb239908..31f54dd5f 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/bedrock/bedrock-titan.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock/bedrock-titan.adoc @@ -84,7 +84,7 @@ Model ID values can also be found in the https://docs.aws.amazon.com/bedrock/lat TIP: All properties prefixed with `spring.ai.bedrock.titan.chat.options` can be overridden at runtime by adding a request specific <> to the `Prompt` call. -=== Chat Options [[chat-options]] +== Runtime Options [[chat-options]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/titan/BedrockTitanChatOptions.java[BedrockTitanChatOptions.java] provides model configurations, such as temperature, topP, etc. @@ -106,7 +106,7 @@ ChatResponse response = chatClient.call( TIP: In addition to the model specific https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/titan/BedrockTitanChatOptions.java[BedrockTitanChatOptions] you can use a portable https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptions.java[ChatOptions] instance, created with the https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptionsBuilder.java[ChatOptionsBuilder#builder()]. -=== Sample Controller (Auto-configuration) +== 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. @@ -201,7 +201,7 @@ Flux response = chatClient.stream( new Prompt("Generate the names of 5 famous pirates.")); ---- -=== Low-level TitanChatBedrockApi Client [[low-level-api]] +== Low-level TitanChatBedrockApi Client [[low-level-api]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/titan/api/TitanChatBedrockApi.java[TitanChatBedrockApi] provides is lightweight Java client on top of AWS Bedrock link:https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-text.html[Bedrock Titan models]. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/azure-open-ai-chat-functions.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/azure-open-ai-chat-functions.adoc similarity index 100% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/azure-open-ai-chat-functions.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/azure-open-ai-chat-functions.adoc diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/mistralai-chat-functions.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/mistralai-chat-functions.adoc similarity index 100% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/mistralai-chat-functions.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/mistralai-chat-functions.adoc diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/openai-chat-functions.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/openai-chat-functions.adoc similarity index 100% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/openai-chat-functions.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/openai-chat-functions.adoc diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/vertexai-gemini-chat-functions.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/vertexai-gemini-chat-functions.adoc similarity index 100% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/vertexai-gemini-chat-functions.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/vertexai-gemini-chat-functions.adoc diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/google-vertexai.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/google-vertexai.adoc similarity index 75% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/google-vertexai.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/google-vertexai.adoc index 68257e3dd..55d209429 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/google-vertexai.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/google-vertexai.adoc @@ -5,5 +5,5 @@ link:https://cloud.google.com/vertex-ai/docs/reference[VertexAI API] provides hi Spring AI provides integration with VertexAI API through the following clients: -* xref:api/clients/vertexai-palm2-chat.adoc[] -* xref:api/clients/vertexai-gemini-chat.adoc[] \ No newline at end of file +* xref:api/chat/vertexai-palm2-chat.adoc[] +* xref:api/chat/vertexai-gemini-chat.adoc[] \ No newline at end of file diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/huggingface.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/huggingface.adoc similarity index 100% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/huggingface.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/huggingface.adoc diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/mistralai-chat.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/mistralai-chat.adoc similarity index 99% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/mistralai-chat.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/mistralai-chat.adoc index 3cb15576d..5395ae05b 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/mistralai-chat.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/mistralai-chat.adoc @@ -108,7 +108,7 @@ This is useful if you want to use different MistralAI accounts for different mod TIP: All properties prefixed with `spring.ai.mistralai.chat.options` can be overridden at runtime by adding a request specific <> to the `Prompt` call. -== Chat Options [[chat-options]] +== Runtime Options [[chat-options]] The link:https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatOptions.java[MistralAiChatOptions.java] provides model configurations, such as the model to use, the temperature, the frequency penalty, etc. @@ -135,7 +135,7 @@ TIP: In addition to the model specific link:https://github.com/spring-projects/s You can register custom Java functions with the MistralAiChatClient and have the Mistral AI model intelligently choose to output a JSON object containing arguments to call one or many of the registered functions. This is a powerful technique to connect the LLM capabilities with external tools and APIs. -Read more about xref:api/clients/functions/mistralai-chat-functions.adoc[Mistral AI Function Calling]. +Read more about xref:api/chat/functions/mistralai-chat-functions.adoc[Mistral AI Function Calling]. == Sample Controller (Auto-configuration) diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/ollama-chat.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/ollama-chat.adoc similarity index 99% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/ollama-chat.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/ollama-chat.adoc index 1938dc0f6..caf813047 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/ollama-chat.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/ollama-chat.adoc @@ -102,7 +102,7 @@ NOTE: The list of options for chat is to be reviewed. This https://github.com/sp TIP: All properties prefixed with `spring.ai.ollama.chat.options` can be overridden at runtime by adding a request specific <> to the `Prompt` call. -=== Chat Options [[chat-options]] +== Runtime Options [[chat-options]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaOptions.java[OllamaOptions.java] provides model configurations, such as the model to use, the temperature, etc. @@ -124,7 +124,7 @@ ChatResponse response = chatClient.call( TIP: In addition to the model specific link:https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaOptions.java[OllamaOptions] you can use a portable https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptions.java[ChatOptions] instance, created with the https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptionsBuilder.java[ChatOptionsBuilder#builder()]. -=== Sample Controller (Auto-configuration) +== 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. @@ -218,7 +218,7 @@ Flux response = chatClient.stream( The `OllamaOptions` provides the configuration information for all chat requests. -=== Low-level OpenAiApi Client [[low-level-api]] +== Low-level OpenAiApi Client [[low-level-api]] The link:https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaApi.java[OllamaApi] provides is lightweight Java client for Ollama Chat API link:https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-chat-completion[Ollama Chat Completion API]. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/openai-chat.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/openai-chat.adoc similarity index 98% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/openai-chat.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/openai-chat.adoc index 0862b1136..e098ba29a 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/openai-chat.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/openai-chat.adoc @@ -112,7 +112,7 @@ This is useful if you want to use different OpenAI accounts for different models TIP: All properties prefixed with `spring.ai.openai.chat.options` can be overridden at runtime by adding a request specific <> to the `Prompt` call. -== Chat Options [[chat-options]] +== Runtime Options [[chat-options]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiChatOptions.java[OpenAiChatOptions.java] provides model configurations, such as the model to use, the temperature, the frequency penalty, etc. @@ -139,9 +139,9 @@ TIP: In addition to the model specific https://github.com/spring-projects/spring You can register custom Java functions with the OpenAiChatClient and have the OpenAI model intelligently choose to output a JSON object containing arguments to call one or many of the registered functions. This is a powerful technique to connect the LLM capabilities with external tools and APIs. -Read more about xref:api/clients/functions/openai-chat-functions.adoc[OpenAI Function Calling]. +Read more about xref:api/chat/functions/openai-chat-functions.adoc[OpenAI Function Calling]. -== Sample Controller (Auto-configuration) +== 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. @@ -233,7 +233,7 @@ Flux response = chatClient.stream( The `OpenAiChatOptions` provides the configuration information for the chat requests. The `OpenAiChatOptions.Builder` is fluent options builder. -=== Low-level OpenAiApi Client [[low-level-api]] +== Low-level OpenAiApi Client [[low-level-api]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiApi.java[OpenAiApi] provides is lightweight Java client for OpenAI Chat API link:https://platform.openai.com/docs/api-reference/chat[OpenAI Chat API]. @@ -262,7 +262,7 @@ Flux streamResponse = openAiApi.chatCompletionStream( Follow the https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiApi.java[OpenAiApi.java]'s JavaDoc for further information. -== Example Code +=== Low-level API Examples * The link:https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/chat/api/OpenAiApiIT.java[OpenAiApiIT.java] test provides some general examples how to use the lightweight library. * The link:https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/chat/api/tool/OpenAiApiToolFunctionCallIT.java[OpenAiApiToolFunctionCallIT.java] test shows how to use the low-level API to call tool functions. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/vertexai-gemini-chat.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/vertexai-gemini-chat.adoc similarity index 98% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/vertexai-gemini-chat.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/vertexai-gemini-chat.adoc index 9e0c444d3..f1d047ad9 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/vertexai-gemini-chat.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/vertexai-gemini-chat.adoc @@ -103,7 +103,7 @@ TIP: In addition to the model specific `VertexAiChatPaLm2Options` you can use a You can register custom Java functions with the VertexAiGeminiChatClient and have the Gemini Pro model intelligently choose to output a JSON object containing arguments to call one or many of the registered functions. This is a powerful technique to connect the LLM capabilities with external tools and APIs. -Read more about xref:api/clients/functions/vertexai-gemini-chat-functions.adoc[Vertex AI Gemini Function Calling]. +Read more about xref:api/chat/functions/vertexai-gemini-chat-functions.adoc[Vertex AI Gemini Function Calling]. == Multimodal Multimodality refers to a model's ability to simultaneously understand and process information from various sources, including text, images, audio, and other data formats. This paradigm represents a significant advancement in AI models. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/vertexai-palm2-chat.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/vertexai-palm2-chat.adoc similarity index 99% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/vertexai-palm2-chat.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/vertexai-palm2-chat.adoc index cc8240ce1..f67a467f0 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/vertexai-palm2-chat.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/vertexai-palm2-chat.adoc @@ -77,7 +77,7 @@ The prefix `spring.ai.vertex.ai.chat` is the property prefix that lets you confi TIP: All properties prefixed with `spring.ai.vertex.ai.chat.options` can be overridden at runtime by adding a request specific <> to the `Prompt` call. -=== Chat Options [[chat-options]] +== Runtime Options [[chat-options]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-vertex-ai-palm2/src/main/java/org/springframework/ai/vertexai/palm2/VertexAiPaLm2ChatOptions.java[VertexAiPaLm2ChatOptions.java] provides model configurations, such as the temperature, the topK, etc. @@ -99,7 +99,7 @@ ChatResponse response = chatClient.call( TIP: In addition to the model specific `VertexAiPaLm2ChatOptions` you can use a portable https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptions.java[ChatOptions] instance, created with the https://github.com/spring-projects/spring-ai/blob/main/spring-ai-core/src/main/java/org/springframework/ai/chat/ChatOptionsBuilder.java[ChatOptionsBuilder#builder()]. -=== Sample Controller (Auto-configuration) +== Sample Controller https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-vertex-ai-palm2-spring-boot-starter` to your pom (or gradle) dependencies. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chatclient.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chatclient.adoc index 128f8aea7..74fc32e26 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chatclient.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chatclient.adoc @@ -175,18 +175,18 @@ The `ChatClient` and `StreamingChatClient` implementations are provided for the image::spring-ai-chat-completions-clients.jpg[align="center", width="800px"] -* xref:api/clients/openai-chat.adoc[OpenAI Chat Completion] (streaming & function-calling support) -* xref:api/clients/azure-openai-chat.adoc[Microsoft Azure Open AI Chat Completion] (streaming & function-calling support) -* xref:api/clients/ollama-chat.adoc[Ollama Chat Completion] -* xref:api/clients/huggingface.adoc[HuggingFace Chat Completion] (no streaming support) -* xref:api/clients/vertexai-palm2-chat.adoc[Google Vertex AI PaLM2 Chat Completion] (no streaming support) -* xref:api/clients/vertexai-gemini-chat.adoc[Google Vertex AI Gemini Chat Completion] (streaming, multi-modality & function-calling support) +* xref:api/chat/openai-chat.adoc[OpenAI Chat Completion] (streaming & function-calling support) +* xref:api/chat/azure-openai-chat.adoc[Microsoft Azure Open AI Chat Completion] (streaming & function-calling support) +* xref:api/chat/ollama-chat.adoc[Ollama Chat Completion] +* xref:api/chat/huggingface.adoc[HuggingFace Chat Completion] (no streaming support) +* xref:api/chat/vertexai-palm2-chat.adoc[Google Vertex AI PaLM2 Chat Completion] (no streaming support) +* xref:api/chat/vertexai-gemini-chat.adoc[Google Vertex AI Gemini Chat Completion] (streaming, multi-modality & function-calling support) * xref:api/bedrock.adoc[Amazon Bedrock] -** xref:api/clients/bedrock/bedrock-cohere.adoc[Cohere Chat Completion] -** xref:api/clients/bedrock/bedrock-llama2.adoc[Llama2 Chat Completion] -** xref:api/clients/bedrock/bedrock-titan.adoc[Titan Chat Completion] -** xref:api/clients/bedrock/bedrock-anthropic.adoc[Anthropic Chat Completion] -* xref:api/clients/mistralai-chat.adoc[Mistral AI Chat Completion] (streaming & function-calling support) +** xref:api/chat/bedrock/bedrock-cohere.adoc[Cohere Chat Completion] +** xref:api/chat/bedrock/bedrock-llama2.adoc[Llama2 Chat Completion] +** xref:api/chat/bedrock/bedrock-titan.adoc[Titan Chat Completion] +** xref:api/chat/bedrock/bedrock-anthropic.adoc[Anthropic Chat Completion] +* xref:api/chat/mistralai-chat.adoc[Mistral AI Chat Completion] (streaming & function-calling support) == Chat Model API diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/azure-openai-embeddings.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/azure-openai-embeddings.adoc index 40fe967c5..b470a97cc 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/azure-openai-embeddings.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/azure-openai-embeddings.adoc @@ -80,7 +80,7 @@ The prefix `spring.ai.azure.openai.embeddings` is the property prefix that confi TIP: All properties prefixed with `spring.ai.azure.openai.embedding.options` can be overridden at runtime by adding a request specific <> to the `EmbeddingRequest` call. -=== Embedding Options [[embedding-options]] +== Runtime Options [[embedding-options]] The `AzureOpenAiEmbeddingOptions` provides the configuration information for the embedding requests. The `AzureOpenAiEmbeddingOptions` offers a builder to create the options. @@ -100,7 +100,7 @@ EmbeddingResponse embeddingResponse = embeddingClient.call( ---- -=== Sample Code +== Sample Code This will create a `EmbeddingClient` implementation that you can inject into your class. Here is an example of a simple `@Controller` class that uses the `EmbeddingClient` implementation. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/bedrock-cohere-embedding.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/bedrock-cohere-embedding.adoc index ce278d89c..2d596bb4b 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/bedrock-cohere-embedding.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/bedrock-cohere-embedding.adoc @@ -79,7 +79,7 @@ Model ID values can also be found in the https://docs.aws.amazon.com/bedrock/lat TIP: All properties prefixed with `spring.ai.bedrock.cohere.embedding.options` can be overridden at runtime by adding a request specific <> to the `EmbeddingRequest` call. -=== Embedding Options [[embedding-options]] +== Runtime Options [[embedding-options]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-bedrock/src/main/java/org/springframework/ai/bedrock/cohere/BedrockCohereEmbeddingOptions.java[BedrockCohereEmbeddingOptions.java] provides model configurations, such as `input-type` or `truncate`. @@ -97,7 +97,7 @@ EmbeddingResponse embeddingResponse = embeddingClient.call( .build())); ---- -=== Sample Controller (Auto-configuration) +== 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. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/bedrock-titan-embedding.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/bedrock-titan-embedding.adoc index 8fbbbebd0..6d5d675a0 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/bedrock-titan-embedding.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/bedrock-titan-embedding.adoc @@ -82,7 +82,7 @@ Supported values are: `amazon.titan-embed-image-v1` and `amazon.titan-embed-text Model ID values can also be found in the https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids-arns.html[AWS Bedrock documentation for base model IDs]. -=== Sample Controller (Auto-configuration) +== 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. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/mistralai-embeddings.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/mistralai-embeddings.adoc index 8cc14e642..b049c030f 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/mistralai-embeddings.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/mistralai-embeddings.adoc @@ -100,7 +100,7 @@ This is useful if you want to use different MistralAI accounts for different mod TIP: All properties prefixed with `spring.ai.mistralai.embedding.options` can be overridden at runtime by adding a request specific <> to the `EmbeddingRequest` call. -=== Embedding Options [[embedding-options]] +== Runtime Options [[embedding-options]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiEmbeddingOptions.java[MistralAiEmbeddingOptions.java] provides the MistralAI configurations, such as the model to use and etc. @@ -120,7 +120,7 @@ EmbeddingResponse embeddingResponse = embeddingClient.call( .build())); ---- -=== Sample Controller (Auto-configuration) +== Sample Controller This will create a `EmbeddingClient` implementation that you can inject into your class. Here is an example of a simple `@Controller` class that uses the `EmbeddingClient` implementation. @@ -175,7 +175,7 @@ dependencies { TIP: Refer to the xref:getting-started.adoc#dependency-management[Dependency Management] section to add the Spring AI BOM to your build file. NOTE: The `spring-ai-mistralai` dependency provides access also to the `MistralAiChatClient`. -For more information about the `MistralAiChatClient` refer to the link:../clients/mistralai-chat.html[MistralAI Chat Client] section. +For more information about the `MistralAiChatClient` refer to the link:../chat/mistralai-chat.html[MistralAI Chat Client] section. Next, create an `MistralAiEmbeddingClient` instance and use it to compute the similarity between two input texts: diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc index c591d6d2d..ff2535517 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc @@ -108,7 +108,7 @@ NOTE: The `spring.ai.ollama.embedding.options.*` properties are based on the htt TIP: All properties prefixed with `spring.ai.ollama.embedding.options` can be overridden at runtime by adding a request specific <> to the `EmbeddingRequest` call. -=== Embedding Options [[embedding-options]] +== Runtime Options [[embedding-options]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaOptions.java[OllamaOptions.java] provides the Ollama configurations, such as the model to use, the low level GPU and CPU tuning, etc. @@ -127,7 +127,7 @@ EmbeddingResponse embeddingResponse = embeddingClient.call( .withModel("Different-Embedding-Model-Deployment-Name")); ---- -=== Sample Controller (Auto-configuration) +== Sample Controller This will create a `EmbeddingClient` implementation that you can inject into your class. Here is an example of a simple `@Controller` class that uses the `EmbeddingClient` implementation. @@ -177,7 +177,7 @@ dependencies { TIP: Refer to the xref:getting-started.adoc#dependency-management[Dependency Management] section to add the Spring AI BOM to your build file. NOTE: The `spring-ai-ollama` dependency provides access also to the `OllamaChatClient`. -For more information about the `OllamaChatClient` refer to the link:../clients/ollama-chat.html[Ollama Chat Client] section. +For more information about the `OllamaChatClient` refer to the link:../chat/ollama-chat.html[Ollama Chat Client] section. Next, create an `OllamaEmbeddingClient` instance and use it to compute the similarity between two input texts: diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/openai-embeddings.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/openai-embeddings.adoc index f61b1bf92..92d55a9d6 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/openai-embeddings.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/openai-embeddings.adoc @@ -102,7 +102,7 @@ This is useful if you want to use different OpenAI accounts for different models TIP: All properties prefixed with `spring.ai.openai.embedding.options` can be overridden at runtime by adding a request specific <> to the `EmbeddingRequest` call. -=== Embedding Options [[embedding-options]] +== Runtime Options [[embedding-options]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiEmbeddingOptions.java[OpenAiEmbeddingOptions.java] provides the OpenAI configurations, such as the model to use and etc. @@ -122,7 +122,7 @@ EmbeddingResponse embeddingResponse = embeddingClient.call( .build())); ---- -=== Sample Controller (Auto-configuration) +== Sample Controller This will create a `EmbeddingClient` implementation that you can inject into your class. Here is an example of a simple `@Controller` class that uses the `EmbeddingClient` implementation. @@ -177,7 +177,7 @@ dependencies { TIP: Refer to the xref:getting-started.adoc#dependency-management[Dependency Management] section to add the Spring AI BOM to your build file. NOTE: The `spring-ai-openai` dependency provides access also to the `OpenAiChatClient`. -For more information about the `OpenAiChatClient` refer to the link:../clients/openai-chat.html[OpenAI Chat Client] section. +For more information about the `OpenAiChatClient` refer to the link:../chat/openai-chat.html[OpenAI Chat Client] section. Next, create an `OpenAiEmbeddingClient` instance and use it to compute the similarity between two input texts: diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/postgresml-embeddings.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/postgresml-embeddings.adoc index 7cf230ad6..a8a506a3f 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/postgresml-embeddings.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/postgresml-embeddings.adoc @@ -59,7 +59,7 @@ The prefix `spring.ai.postgresml.embedding` is property prefix that configures t TIP: All properties prefixed with `spring.ai.postgresml.embedding.options` can be overridden at runtime by adding a request specific <> to the `EmbeddingRequest` call. -=== EmbeddingOptions [[embedding-options]] +== Runtime Options [[embedding-options]] Use the https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-openai/src/main/java/org/springframework/ai/postgresml/PostgresMlEmbeddingOptions.java[PostgresMlEmbeddingOptions.java] to configure the `PostgresMlEmbeddingClient` with options, such as the model to use and etc. @@ -82,7 +82,7 @@ EmbeddingResponse embeddingResponse = embeddingClient.call( .build())); ---- -=== Sample Controller (Auto-configuration) +== Sample Controller This will create a `EmbeddingClient` implementation that you can inject into your class. Here is an example of a simple `@Controller` class that uses the `EmbeddingClient` implementation. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/vertexai-embeddings.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/vertexai-embeddings.adoc index 267ab8273..d66b94071 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/vertexai-embeddings.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/vertexai-embeddings.adoc @@ -72,7 +72,7 @@ The prefix `spring.ai.vertex.ai.embedding` is the property prefix that lets you |==== -=== Sample Controller (Auto-configuration) +== Sample Controller https://start.spring.io/[Create] a new Spring Boot project and add the `spring-ai-vertex-ai-palm2-spring-boot-starter` to your pom (or gradle) dependencies. @@ -146,7 +146,7 @@ EmbeddingResponse embeddingResponse = embeddingClient .embedForResponse(List.of("Hello World", "World is big and salvation is near")); ---- -=== Low-level VertexAiPaLm2Api Client [[low-level-api]] +== Low-level VertexAiPaLm2Api Client [[low-level-api]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-vertex-ai-palm2/src/main/java/org/springframework/ai/vertexai/palm2/api/VertexAiPaLm2Api.java[VertexAiPaLm2Api] provides is lightweight Java client for VertexAiPaLm2Api Chat API. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/functions.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/functions.adoc index e23b43c1b..c8a7e5f92 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/functions.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/functions.adoc @@ -5,7 +5,7 @@ The integration of function support in AI models, such as ChatGPT, permits the m Spring AI currently supports Function invocation for the following AI Models -* OpenAI: Refer to the xref:api/clients/functions/openai-chat-functions.adoc[Open AI function invocation docs]. -* VertexAI Gemini: Refer to the xref:api/clients/functions/vertexai-gemini-chat-functions.adoc[Vertex AI Gemini function invocation docs]. -* Azure OpenAI: Refer to the xref:api/clients/functions/azure-open-ai-chat-functions.adoc[Azure OpenAI function invocation docs]. -* Mistral AI: Refer to the xref:api/clients/functions/mistralai-chat-functions.adoc[Mistral AI function invocation docs]. \ No newline at end of file +* OpenAI: Refer to the xref:api/chat/functions/openai-chat-functions.adoc[Open AI function invocation docs]. +* VertexAI Gemini: Refer to the xref:api/chat/functions/vertexai-gemini-chat-functions.adoc[Vertex AI Gemini function invocation docs]. +* Azure OpenAI: Refer to the xref:api/chat/functions/azure-open-ai-chat-functions.adoc[Azure OpenAI function invocation docs]. +* Mistral AI: Refer to the xref:api/chat/functions/mistralai-chat-functions.adoc[Mistral AI function invocation docs]. \ No newline at end of file diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/image/openai-image.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/image/openai-image.adoc similarity index 100% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/image/openai-image.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/image/openai-image.adoc diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/image/stabilityai-image.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/image/stabilityai-image.adoc similarity index 99% rename from spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/image/stabilityai-image.adoc rename to spring-ai-docs/src/main/antora/modules/ROOT/pages/api/image/stabilityai-image.adoc index 10bc1c98b..6cb28510e 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/image/stabilityai-image.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/image/stabilityai-image.adoc @@ -74,7 +74,7 @@ The prefix `spring.ai.stabilityai.image` is the property prefix that lets you co |==== -=== Image Options [[image-options]] +== Runtime Options [[image-options]] The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-stabilityai/src/main/java/org/springframework/ai/stabilityai/api/StabilityAiImageOptions.java[StabilityAiImageOptions.java] provides model configurations, such as the model to use, the style, the size, etc. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/imageclient.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/imageclient.adoc index 204cf4009..3d73ce061 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/imageclient.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/imageclient.adoc @@ -159,8 +159,8 @@ public class ImageGeneration implements ModelResult { `ImageClient` implementations are provided for the following Model providers: -* xref:api/clients/image/openai-image.adoc[OpenAI Image Generation] -* xref:api/clients/image/stabilityai-image.adoc[StabilityAI Image Generation] +* xref:api/image/openai-image.adoc[OpenAI Image Generation] +* xref:api/image/stabilityai-image.adoc[StabilityAI Image Generation] == API Docs diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/contribution-guidelines.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/contribution-guidelines.adoc index eabf39fd8..73cd31e5d 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/contribution-guidelines.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/contribution-guidelines.adoc @@ -17,7 +17,7 @@ you'll need to develop a low-level client API class. This often involves utilizi `RestClient` class from the Spring Framework, similar to the `OpenAiApi` class. . *Create a ModelClient implementation* -Ensure your client conforms to the link:https://docs.spring.io/spring-ai/reference/api/clients/generic-model.html[Generic Model API]. +Ensure your client conforms to the link:https://docs.spring.io/spring-ai/reference/api/chat/generic-model.html[Generic Model API]. Use existing request and response classes if your model's inputs and outputs are supported. If not, create new classes for the Generic Model API and establish a new Java package. @@ -30,7 +30,7 @@ Existing tests can serve as a useful reference for structuring and implementing . *Document Your Contribution*: Ensure your documentation follows the existing format, For an example of the suggested structure and formatting, refer to the -link:https://docs.spring.io/spring-ai/reference/api/clients/openai-chat.html[Open AI Chat documentation]. +link:https://docs.spring.io/spring-ai/reference/api/chat/openai-chat.html[Open AI Chat documentation]. By following these guidelines, we can greatly expand the framework's range of supported models while following a common implementation and documentation pattern. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/getting-started.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/getting-started.adoc index e2d037ab0..13d555b90 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/getting-started.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/getting-started.adoc @@ -139,24 +139,24 @@ Each of the following sections in the documentation shows which dependencies you === Chat Models * xref:api/chatclient.adoc[Chat Completion API] -** xref:api/clients/openai-chat.adoc[OpenAI Chat Completion] (streaming and function-calling support) -** xref:api/clients/azure-openai-chat.adoc[Microsoft Azure Open AI Chat Completion] (streaming and function-calling support) -** xref:api/clients/ollama-chat.adoc[Ollama Chat Completion] -** xref:api/clients/huggingface.adoc[HuggingFace Chat Completion] (no streaming support) -** xref:api/clients/vertexai-palm2-chat.adoc[Google Vertex AI PaLM2 Chat Completion] (no streaming support) -** xref:api/clients/vertexai-gemini-chat.adoc[Google Vertex AI Gemini Chat Completion] (streaming, multi-modality & function-calling support) +** xref:api/chat/openai-chat.adoc[OpenAI Chat Completion] (streaming and function-calling support) +** xref:api/chat/azure-openai-chat.adoc[Microsoft Azure Open AI Chat Completion] (streaming and function-calling support) +** xref:api/chat/ollama-chat.adoc[Ollama Chat Completion] +** xref:api/chat/huggingface.adoc[HuggingFace Chat Completion] (no streaming support) +** xref:api/chat/vertexai-palm2-chat.adoc[Google Vertex AI PaLM2 Chat Completion] (no streaming support) +** xref:api/chat/vertexai-gemini-chat.adoc[Google Vertex AI Gemini Chat Completion] (streaming, multi-modality & function-calling support) ** xref:api/bedrock.adoc[Amazon Bedrock] -*** xref:api/clients/bedrock/bedrock-cohere.adoc[Cohere Chat Completion] -*** xref:api/clients/bedrock/bedrock-llama2.adoc[Llama2 Chat Completion] -*** xref:api/clients/bedrock/bedrock-titan.adoc[Titan Chat Completion] -*** xref:api/clients/bedrock/bedrock-anthropic.adoc[Anthropic Chat Completion] -** xref:api/clients/mistralai-chat.adoc[MistralAI Chat Completion] (streaming and function-calling support) -// ** xref:api/clients/bedrock/bedrock-jurassic.adoc[Jurassic2 Chat Completion] (WIP, no streaming support) +*** xref:api/chat/bedrock/bedrock-cohere.adoc[Cohere Chat Completion] +*** xref:api/chat/bedrock/bedrock-llama2.adoc[Llama2 Chat Completion] +*** xref:api/chat/bedrock/bedrock-titan.adoc[Titan Chat Completion] +*** xref:api/chat/bedrock/bedrock-anthropic.adoc[Anthropic Chat Completion] +** xref:api/chat/mistralai-chat.adoc[MistralAI Chat Completion] (streaming and function-calling support) +// ** xref:api/chat/bedrock/bedrock-jurassic.adoc[Jurassic2 Chat Completion] (WIP, no streaming support) === Image Generation Models * xref:api/imageclient.adoc[] -** xref:api/clients/image/openai-image.adoc[OpenAI Image Generation] -** xref:api/clients/image/stabilityai-image.adoc[StabilityAI Image Generation] +** xref:api/image/openai-image.adoc[OpenAI Image Generation] +** xref:api/image/stabilityai-image.adoc[StabilityAI Image Generation] === Vector Databases * xref:api/vectordbs.adoc[Vector Database API] diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc index e5c9e31c0..5072f31be 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc @@ -68,7 +68,7 @@ The following OpenAi Autoconfiguration chat properties has changed * from `spring.ai.openai.model` to `spring.ai.openai.chat.options.model`. * from `spring.ai.openai.temperature` to `spring.ai.openai.chat.options.temperature`. -Find updated documentation about the OpenAi properties: https://docs.spring.io/spring-ai/reference/api/clients/openai-chat.html +Find updated documentation about the OpenAi properties: https://docs.spring.io/spring-ai/reference/api/chat/openai-chat.html === December 27, 2023 Update