From 7aa440e6bcac14c4b6755da24ad377d9d81d93fe Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Sun, 11 May 2025 21:55:54 +0700 Subject: [PATCH] Fix typos Signed-off-by: Tran Ngoc Nhan --- .../tool/FunctionCallWithFunctionBeanIT.java | 6 +++--- ...atClientMethodInvokingFunctionCallbackIT.java | 4 ++-- ...hatClientToolsWithGenericArgumentTypesIT.java | 8 ++++---- .../converse/client/BedrockNovaChatClientIT.java | 10 +++++----- ...hatClientToolsWithGenericArgumentTypesIT.java | 6 +++--- .../ROOT/pages/api/chat/bedrock-converse.adoc | 16 ++++++++-------- .../CouchbaseSearchVectorStoreIT.java | 2 +- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/auto-configurations/models/spring-ai-autoconfigure-model-vertex-ai/src/test/java/org/springframework/ai/model/vertexai/autoconfigure/gemini/tool/FunctionCallWithFunctionBeanIT.java b/auto-configurations/models/spring-ai-autoconfigure-model-vertex-ai/src/test/java/org/springframework/ai/model/vertexai/autoconfigure/gemini/tool/FunctionCallWithFunctionBeanIT.java index 9c0cf1ca1..661996f69 100644 --- a/auto-configurations/models/spring-ai-autoconfigure-model-vertex-ai/src/test/java/org/springframework/ai/model/vertexai/autoconfigure/gemini/tool/FunctionCallWithFunctionBeanIT.java +++ b/auto-configurations/models/spring-ai-autoconfigure-model-vertex-ai/src/test/java/org/springframework/ai/model/vertexai/autoconfigure/gemini/tool/FunctionCallWithFunctionBeanIT.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,7 +65,7 @@ class FunctionCallWithFunctionBeanIT { var userMessage = new UserMessage(""" What's the weather like in San Francisco, Paris and in Tokyo? Return the temperature in Celsius. - Perform multiple funciton execution if necessary. + Perform multiple function execution if necessary. """); ChatResponse response = chatModel.call(new Prompt(List.of(userMessage), @@ -105,7 +105,7 @@ class FunctionCallWithFunctionBeanIT { var userMessage = new UserMessage(""" What's the weather like in San Francisco, Paris and in Tokyo? Return the temperature in Celsius. - Perform multiple funciton execution if necessary. + Perform multiple function execution if necessary. """); ChatResponse response = chatModel.call(new Prompt(List.of(userMessage), diff --git a/models/spring-ai-anthropic/src/test/java/org/springframework/ai/anthropic/client/AnthropicChatClientMethodInvokingFunctionCallbackIT.java b/models/spring-ai-anthropic/src/test/java/org/springframework/ai/anthropic/client/AnthropicChatClientMethodInvokingFunctionCallbackIT.java index 09f10e889..d6f396f7a 100644 --- a/models/spring-ai-anthropic/src/test/java/org/springframework/ai/anthropic/client/AnthropicChatClientMethodInvokingFunctionCallbackIT.java +++ b/models/spring-ai-anthropic/src/test/java/org/springframework/ai/anthropic/client/AnthropicChatClientMethodInvokingFunctionCallbackIT.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -335,7 +335,7 @@ class AnthropicChatClientMethodInvokingFunctionCallbackIT { public void changeRoomLightColor(String roomName, LightColor color) { arguments.put("roomName", roomName); arguments.put("color", color); - logger.info("Change light colur in room: {} to color: {}", roomName, color); + logger.info("Change light color in room: {} to color: {}", roomName, color); } } diff --git a/models/spring-ai-anthropic/src/test/java/org/springframework/ai/anthropic/client/ChatClientToolsWithGenericArgumentTypesIT.java b/models/spring-ai-anthropic/src/test/java/org/springframework/ai/anthropic/client/ChatClientToolsWithGenericArgumentTypesIT.java index 525a6502c..772ea7a96 100644 --- a/models/spring-ai-anthropic/src/test/java/org/springframework/ai/anthropic/client/ChatClientToolsWithGenericArgumentTypesIT.java +++ b/models/spring-ai-anthropic/src/test/java/org/springframework/ai/anthropic/client/ChatClientToolsWithGenericArgumentTypesIT.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,8 +59,8 @@ class ChatClientToolsWithGenericArgumentTypesIT { void toolWithGenericArgumentTypes() { // @formatter:off String response = ChatClient.create(this.chatModel).prompt() - .user("Turn light red in the living room and the kitchen. Please group the romms with the same color in a single tool call.") - .tools(new TestToolProvider()) + .user("Turn light red in the living room and the kitchen. Please group the rooms with the same color in a single tool call.") + .tools(new TestToolProvider()) .call() .content(); // @formatter:on @@ -86,7 +86,7 @@ class ChatClientToolsWithGenericArgumentTypesIT { @Tool(description = "Change the lamp color in a room.") public void changeRoomLightColor( - @ToolParam(description = "List of rooms to change the ligth color for") List rooms, + @ToolParam(description = "List of rooms to change the light color for") List rooms, @ToolParam(description = "light color to change to") LightColor color) { logger.info("Change light color in rooms: {} to color: {}", rooms, color); diff --git a/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/client/BedrockNovaChatClientIT.java b/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/client/BedrockNovaChatClientIT.java index 979759eb5..bcb3ea626 100644 --- a/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/client/BedrockNovaChatClientIT.java +++ b/models/spring-ai-bedrock-converse/src/test/java/org/springframework/ai/bedrock/converse/client/BedrockNovaChatClientIT.java @@ -184,7 +184,7 @@ public class BedrockNovaChatClientIT { ChatClient chatClient = ChatClient.builder(this.chatModel).build(); String response = chatClient.prompt() - .tools(new DummyWeatherForcastTools()) + .tools(new DummyWeatherForecastTools()) .user("Get current weather in Amsterdam") .call() .content(); @@ -199,7 +199,7 @@ public class BedrockNovaChatClientIT { ChatClient chatClient = ChatClient.builder(this.chatModel).build(); Flux responses = chatClient.prompt() - .tools(new DummyWeatherForcastTools()) + .tools(new DummyWeatherForecastTools()) .user("Get current weather in Amsterdam") .stream() .chatResponse(); @@ -214,11 +214,11 @@ public class BedrockNovaChatClientIT { assertThat(content).contains("20 degrees"); } - public static class DummyWeatherForcastTools { + public static class DummyWeatherForecastTools { - @Tool(description = "Get the current weather forcast in Amsterdam") + @Tool(description = "Get the current weather forecast in Amsterdam") String getCurrentDateTime() { - return "Weahter is hot and sunny wiht a temperature of 20 degrees"; + return "Weather is hot and sunny with a temperature of 20 degrees"; } } diff --git a/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/chat/client/ChatClientToolsWithGenericArgumentTypesIT.java b/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/chat/client/ChatClientToolsWithGenericArgumentTypesIT.java index 779009fe0..a108e5cde 100644 --- a/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/chat/client/ChatClientToolsWithGenericArgumentTypesIT.java +++ b/models/spring-ai-openai/src/test/java/org/springframework/ai/openai/chat/client/ChatClientToolsWithGenericArgumentTypesIT.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,7 +61,7 @@ class ChatClientToolsWithGenericArgumentTypesIT { void toolWithGenericArgumentTypes() { // @formatter:off String response = ChatClient.create(this.chatModel).prompt() - .user("Turn light red in the living room and the kitchen. Please group the romms with the same color in a single tool call.") + .user("Turn light red in the living room and the kitchen. Please group the rooms with the same color in a single tool call.") .tools(new TestToolProvider()) .call() .content(); @@ -88,7 +88,7 @@ class ChatClientToolsWithGenericArgumentTypesIT { @Tool(description = "Change the lamp color in a room.") public void changeRoomLightColor( - @ToolParam(description = "List of rooms to change the ligth color for") List rooms, + @ToolParam(description = "List of rooms to change the light color for") List rooms, @ToolParam(description = "light color to change to") LightColor color) { logger.info("Change light color in rooms: {} to color: {}", rooms, color); diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock-converse.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock-converse.adoc index 7de2c093f..f353d7d99 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock-converse.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock-converse.adoc @@ -10,12 +10,12 @@ The Bedrock Converse API has the following high-level features: * System Messages: Support for system-level instructions and context setting TIP: The Bedrock Converse API provides a unified interface across multiple model providers while handling AWS-specific authentication and infrastructure concerns. -Currently, the Converse API link:https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html[Supported Models] inlcude: +Currently, the Converse API link:https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html[Supported Models] include: `Amazon Titan`, `Amazon Nova`, `AI21 Labs`, `Anthropic Claude`, `Cohere Command`, `Meta Llama`, `Mistral AI`. [NOTE] ==== -Following the Bedrock recommendations, Spring AI is transitioning to using Amazon Bedrock's Converse API for all chat conversation implementations in Spring AI. +Following the Bedrock recommendations, Spring AI is transitioning to using Amazon Bedrock's Converse API for all chat conversation implementations in Spring AI. While the existing xref:api/bedrock-chat.adoc[InvokeModel API] supports conversation applications, we strongly recommend adopting the Converse API for all Chat conversation models. The Converse API does not support embedding operations, so these will remain in the current API and the embedding model functionality in the existing `InvokeModel API` will be maintained @@ -135,7 +135,7 @@ String response = ChatClient.create(this.chatModel) == Tool Calling -The Bedrock Converse API supports tool calling capabilities, allowing models to use tools during conversations. +The Bedrock Converse API supports tool calling capabilities, allowing models to use tools during conversations. Here's an example of how to define and use @Tool based tools: [source,java] @@ -150,7 +150,7 @@ public class WeatherService { } String response = ChatClient.create(this.chatModel) - .prompt("What's the weather like in Boston?") + .prompt("What's the weather like in Boston?") .tools(new WeatherService()) .call() .content(); @@ -167,7 +167,7 @@ public Function weatherFunction() { } String response = ChatClient.create(this.chatModel) - .prompt("What's the weather like in Boston?") + .prompt("What's the weather like in Boston?") .tools("weatherFunction") .inputType(Request.class) .call() @@ -178,7 +178,7 @@ Find more in xref:api/tools.adoc[Tools] documentation. == Multimodal -Multimodality refers to a model's ability to simultaneously understand and process information from various sources, including text, images, video, pdf, doc, html, md and more data formats. +Multimodality refers to a model's ability to simultaneously understand and process information from various sources, including text, images, video, pdf, doc, html, md and more data formats. The Bedrock Converse API supports multimodal inputs, including text and image inputs, and can generate a text response based on the combined input. @@ -248,13 +248,13 @@ image::test.video.jpeg[Multimodal Test Video, 200, 200, align="left"] along with the text message "Explain what do you see in this video?", and generates a response something like: ---- -The video shows a group of baby chickens, also known as chicks, huddled together on a surface +The video shows a group of baby chickens, also known as chicks, huddled together on a surface ... ---- === Documents -For some models, Bedrock allows you to include documents in the payload through Converse API document support, which can be provided in bytes. +For some models, Bedrock allows you to include documents in the payload through Converse API document support, which can be provided in bytes. The document support has two different variants as explained below: - **Text document types** (txt, csv, html, md, and so on), where the emphasis is on text understanding. These use case include answering based on textual elements of the document. diff --git a/vector-stores/spring-ai-couchbase-store/src/test/java/org/springframework/ai/vectorstore/CouchbaseSearchVectorStoreIT.java b/vector-stores/spring-ai-couchbase-store/src/test/java/org/springframework/ai/vectorstore/CouchbaseSearchVectorStoreIT.java index 3484dae49..dba84ff4c 100644 --- a/vector-stores/spring-ai-couchbase-store/src/test/java/org/springframework/ai/vectorstore/CouchbaseSearchVectorStoreIT.java +++ b/vector-stores/spring-ai-couchbase-store/src/test/java/org/springframework/ai/vectorstore/CouchbaseSearchVectorStoreIT.java @@ -293,7 +293,7 @@ public class CouchbaseSearchVectorStoreIT { CouchbaseSearchVectorStore.Builder builder = CouchbaseSearchVectorStore.builder(cluster, embeddingModel) .bucketName("springBucket") .scopeName("springScope") - .collectionName("sprtingcollection"); + .collectionName("springCollection"); return builder.initializeSchema(true).build(); }