Skip to content

Commit b0772f0

Browse files
committed
Improve docs
1 parent 643ad81 commit b0772f0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/bedrock-converse.adoc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ var options = FunctionCallingOptions.builder()
108108
.build()))
109109
.build();
110110
111-
ChatResponse response = chatModel.call(new Prompt("What is current weather in Amsterdam?", options));
111+
String response = ChatClient.create(this.chatModel)
112+
.prompt("What is current weather in Amsterdam?")
113+
.options()
114+
.call(options)
115+
.content();
112116
----
113117

114118
== Tool/Function Calling
@@ -126,6 +130,7 @@ public Function<Request, Response> weatherFunction() {
126130
String response = ChatClient.create(this.chatModel)
127131
.prompt("What's the weather like in Boston?")
128132
.function("weatherFunction")
133+
.inputType(Request.class)
129134
.call()
130135
.content();
131136
----
@@ -144,7 +149,7 @@ For link:https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-infer
144149

145150
Currently, Bedrock Converse supports the `base64` encoded images of `image/jpeg`, `image/png`, `image/gif` and `image/webp` mime types.
146151

147-
Spring AI's `Message` interface supports multimodal AI models by introducing the `Media`` type.
152+
Spring AI's `Message` interface supports multimodal AI models by introducing the `Media` type.
148153
It contains data and information about media attachments in messages, using Spring's `org.springframework.util.MimeType` and a `java.lang.Object` for the raw media data.
149154

150155
Below is a simple code example, demonstrating the combination of user text with an image.
@@ -231,6 +236,8 @@ String response = ChatClient.create(chatModel)
231236
logger.info(response);
232237
----
233238

239+
It takes as an input the `spring-ai-reference-overview.pdf` document:
240+
234241
image::test.pdf.png[Multimodal Test PNG, 200, 200, align="left"]
235242

236243
along with the text message "You are a very professional document summarization specialist. Please summarize the given document.", and generates a response something like:

0 commit comments

Comments
 (0)