Class AiChatMessageContext

java.lang.Object
io.jmix.aichat.data.AiChatMessageContext

public class AiChatMessageContext extends Object
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 Details

    • role

      protected AiMessageRole role
    • content

      protected String content
    • attachments

      protected List<com.vaadin.flow.component.ai.common.AIAttachment> 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, not null
      content - the text content, not null
      attachments - the files attached to the message, not null, may be empty
  • Method Details

    • getRole

      public AiMessageRole getRole()
      Returns the role of the message to create.
      Returns:
      the message role
    • getContent

      public String getContent()
      Returns the text content of the message to create.
      Returns:
      the text content
    • getAttachments

      public List<com.vaadin.flow.component.ai.common.AIAttachment> 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)