Package io.jmix.aichat.data
Class AiChatMessageContext
java.lang.Object
io.jmix.aichat.data.AiChatMessageContext
Everything
AiChatMessageFactory is given about the message it is asked to mint.
A single argument rather than a parameter list, so that a value added later reaches every
factory without changing the interface every application implements.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<com.vaadin.flow.component.ai.common.AIAttachment> protected Stringprotected AiMessageRole -
Constructor Summary
ConstructorsConstructorDescriptionAiChatMessageContext(AiMessageRole role, String content, List<com.vaadin.flow.component.ai.common.AIAttachment> attachments) Creates a context. -
Method Summary
-
Field Details
-
role
-
-
attachments
-
-
Constructor Details
-
AiChatMessageContext
public AiChatMessageContext(AiMessageRole role, String content, List<com.vaadin.flow.component.ai.common.AIAttachment> attachments) Creates a context.- Parameters:
role- the role of the message to create, notnullcontent- the text content, notnullattachments- the files attached to the message, notnull, may be empty
-
-
Method Details
-
getRole
Returns the role of the message to create.- Returns:
- the message role
-
getContent
Returns the text content of the message to create.- Returns:
- the text content
-
getAttachments
Returns the files attached to the message. Empty for an assistant message, and for a user message that carried none.- Returns:
- an unmodifiable view of the attachments (never
null)
-