Skip to content

Commit 1b923c2

Browse files
authored
fix: Fixed the example code error in multimodality (#4475)
Auto-cherry-pick to 1.0.x Fixes #4475 Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com> Co-authored-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
1 parent f907196 commit 1b923c2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/multimodality.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ For most of the multimodal LLMs, the Spring AI code would look something like th
4141
----
4242
var imageResource = new ClassPathResource("/multimodal.test.png");
4343
44-
var userMessage = new UserMessage(
45-
"Explain what do you see in this picture?", // content
46-
new Media(MimeTypeUtils.IMAGE_PNG, this.imageResource)); // media
44+
var userMessage = UserMessage.builder()
45+
.text("Explain what do you see in this picture?") // content
46+
.media(new Media(MimeTypeUtils.IMAGE_PNG, this.imageResource)) // media
47+
.build();
4748
4849
ChatResponse response = chatModel.call(new Prompt(this.userMessage));
4950
----

0 commit comments

Comments
 (0)