Class UserMessage.Builder

java.lang.Object
org.springframework.ai.chat.messages.UserMessage.Builder
Enclosing class:
UserMessage

public static final class UserMessage.Builder extends Object
Builder for UserMessage.

Parts added through part(MessagePart) and parts(List) keep their order. text(String) and text(Resource) replace the text parts: the new text takes the place of the first text part, or comes first when there is none. media(List) replaces the media parts: the new media go where the first media part was, or last when there is none. A builder without explicit parts therefore produces the legacy order, text then media.