Skip to content

Conversation

sunyuhan1998
Copy link
Contributor

In the following section of the Multimodality API documentation, the constructor method for UserMessage used in the example code no longer exists:

For most of the multimodal LLMs, the Spring AI code would look something like this:
[source,java]
----
var imageResource = new ClassPathResource("/multimodal.test.png");
var userMessage = new UserMessage(
"Explain what do you see in this picture?", // content
new Media(MimeTypeUtils.IMAGE_PNG, this.imageResource)); // media
ChatResponse response = chatModel.call(new Prompt(this.userMessage));
----

The current PR modifies it to use the Builder pattern for construction.

@ilayaperumalg ilayaperumalg self-assigned this Sep 26, 2025
@ilayaperumalg ilayaperumalg added multimodality documentation Improvements or additions to documentation labels Sep 26, 2025
@ilayaperumalg ilayaperumalg added this to the 1.1.0.M3 milestone Sep 26, 2025
@ilayaperumalg
Copy link
Member

@sunyuhan1998 Thanks for the PR fixing the doc.

@ilayaperumalg ilayaperumalg merged commit 1b923c2 into spring-projects:main Sep 26, 2025
2 checks passed
spring-builds pushed a commit that referenced this pull request Sep 26, 2025
Fixes #4475

Signed-off-by: Sun Yuhan <[email protected]>
Co-authored-by: Sun Yuhan <[email protected]>
(cherry picked from commit 1b923c2)
Willam2004 pushed a commit to Willam2004/spring-ai that referenced this pull request Oct 11, 2025
)

Auto-cherry-pick to 1.0.x
Fixes spring-projects#4475

Signed-off-by: Sun Yuhan <[email protected]>
Co-authored-by: Sun Yuhan <[email protected]>
Signed-off-by: 家娃 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants