Class UserMessage.Builder
java.lang.Object
org.springframework.ai.chat.messages.UserMessage.Builder
- Enclosing class:
- UserMessage
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()part(MessagePart part) Adds a part.parts(List<MessagePart> parts) Adds parts, in order.text(org.springframework.core.io.Resource resource)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
part
Adds a part.- Parameters:
part- the part- Returns:
- this builder
- Since:
- 2.1.0
-
parts
Adds parts, in order.- Parameters:
parts- the parts- Returns:
- this builder
- Since:
- 2.1.0
-
text
-
text
-
media
-
media
-
metadata
-
build
-