Skip to content

Fix typos #3100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -65,7 +65,7 @@ void functionCallTest() {
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),
Expand Down Expand Up @@ -105,7 +105,7 @@ void functionCallWithPortableFunctionCallingOptions() {
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),
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -335,7 +335,7 @@ enum LightColor {
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);
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -59,8 +59,8 @@ void beforeEach() {
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
Expand All @@ -86,7 +86,7 @@ public static class TestToolProvider {

@Tool(description = "Change the lamp color in a room.")
public void changeRoomLightColor(
@ToolParam(description = "List of rooms to change the ligth color for") List<Room> rooms,
@ToolParam(description = "List of rooms to change the light color for") List<Room> rooms,
@ToolParam(description = "light color to change to") LightColor color) {

logger.info("Change light color in rooms: {} to color: {}", rooms, color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void toolAnnotationWeatherForecast() {
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();
Expand All @@ -199,7 +199,7 @@ void toolAnnotationWeatherForecastStreaming() {
ChatClient chatClient = ChatClient.builder(this.chatModel).build();

Flux<ChatResponse> responses = chatClient.prompt()
.tools(new DummyWeatherForcastTools())
.tools(new DummyWeatherForecastTools())
.user("Get current weather in Amsterdam")
.stream()
.chatResponse();
Expand All @@ -214,11 +214,11 @@ void toolAnnotationWeatherForecastStreaming() {
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";
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -61,7 +61,7 @@ void beforeEach() {
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();
Expand All @@ -88,7 +88,7 @@ public static class TestToolProvider {

@Tool(description = "Change the lamp color in a room.")
public void changeRoomLightColor(
@ToolParam(description = "List of rooms to change the ligth color for") List<Room> rooms,
@ToolParam(description = "List of rooms to change the light color for") List<Room> rooms,
@ToolParam(description = "light color to change to") LightColor color) {

logger.info("Change light color in rooms: {} to color: {}", rooms, color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand All @@ -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();
Expand All @@ -167,7 +167,7 @@ public Function<Request, Response> 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()
Expand All @@ -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.

Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public CouchbaseSearchVectorStore vectorStore(EmbeddingModel embeddingModel) {
CouchbaseSearchVectorStore.Builder builder = CouchbaseSearchVectorStore.builder(cluster, embeddingModel)
.bucketName("springBucket")
.scopeName("springScope")
.collectionName("sprtingcollection");
.collectionName("springCollection");

return builder.initializeSchema(true).build();
}
Expand Down