Class RequestListener.RequestEvent

java.lang.Object
com.vaadin.flow.component.ai.orchestrator.RequestListener.RequestEvent
All Implemented Interfaces:
Serializable
Enclosing interface:
RequestListener

public static class RequestListener.RequestEvent extends Object implements Serializable
Event fired just before the LLM stream opens for a prompt. Carries the user message, the assigned messageId that will be stored on the resulting ChatMessage, and the attachments included with the message (empty list when none). The same event is passed to AIController.onRequest.
See Also:
  • Constructor Details

    • RequestEvent

      public RequestEvent(String userMessage, String messageId, List<AIAttachment> attachments)
      Creates a request event. The orchestrator builds this for every turn; it is public so an application can construct one when unit testing an AIController implementation.
      Parameters:
      userMessage - the user message being submitted, not null
      messageId - the unique identifier assigned to the message, not null
      attachments - the attachments included with the message, not null; copied, so later changes to the given list do not affect the event
      Throws:
      NullPointerException - if userMessage, messageId or attachments is null, or attachments contains null elements
      Since:
      25.3
  • Method Details

    • getUserMessage

      public String getUserMessage()
      Gets the user message being submitted to the LLM.
      Returns:
      the user message, never null
    • getMessageId

      public String getMessageId()
      Gets the unique identifier assigned to this message. The same id is available via ChatMessage.messageId() in the conversation history and via AttachmentClickListener.AttachmentClickEvent.getMessageId() on attachment click.
      Returns:
      the message id, never null
    • getAttachments

      public List<AIAttachment> getAttachments()
      Gets the attachments included with the request.
      Returns:
      unmodifiable list of attachments with full data; empty when the message has no attachments, never null