Package de.espirit.firstspirit.ai.dto
Interface Message.Builder
- Enclosing interface:
- Message
public static interface Message.Builder
Builder for a message object.
- Since:
- 5.2.240708
-
Method Summary
Modifier and TypeMethodDescription@NotNull Message.Builder
addContent
(@NotNull MessagePart part) Adds a new message content part to this message.default @NotNull Message.Builder
addImageUrl
(@NotNull String url) Adds an image URL to this message.default @NotNull Message.Builder
Adds textual content to this message.@NotNull Message
create()
Creates a new message object.@NotNull Message.Builder
Configures the role of the message author,Message.USER
by default.
-
Method Details
-
addContent
@Contract("_ -> this") @NotNull @NotNull Message.Builder addContent(@NotNull @NotNull MessagePart part) Adds a new message content part to this message.- Parameters:
part
- The message content part to be added.- Returns:
- This builder instance.
- Since:
- 5.2.240708
-
addText
@Contract("_ -> this") @NotNull default @NotNull Message.Builder addText(@NotNull @NotNull String text) Adds textual content to this message.- Parameters:
text
- The text to be added.- Returns:
- This builder instance.
- Since:
- 5.2.240708
-
addImageUrl
@Contract("_ -> this") @NotNull default @NotNull Message.Builder addImageUrl(@NotNull @NotNull String url) Adds an image URL to this message.- Parameters:
url
- The image URL to be added.- Returns:
- This builder instance.
- Since:
- 5.2.240708
-
role
Configures the role of the message author,Message.USER
by default.- Parameters:
role
- The message author role.- Returns:
- This builder instance.
- Since:
- 5.2.240708
-
create
Creates a new message object.- Returns:
- The new message instance.
- Since:
- 5.2.240708
-