Class RequestListener.RequestEvent
java.lang.Object
com.vaadin.flow.component.ai.orchestrator.RequestListener.RequestEvent
- All Implemented Interfaces:
Serializable
- Enclosing interface:
RequestListener
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 Summary
ConstructorsConstructorDescriptionRequestEvent(String userMessage, String messageId, List<AIAttachment> attachments) Creates a request event. -
Method Summary
Modifier and TypeMethodDescriptionGets the attachments included with the request.Gets the unique identifier assigned to this message.Gets the user message being submitted to the LLM.
-
Constructor Details
-
RequestEvent
Creates a request event. The orchestrator builds this for every turn; it is public so an application can construct one when unit testing anAIControllerimplementation.- Parameters:
userMessage- the user message being submitted, notnullmessageId- the unique identifier assigned to the message, notnullattachments- the attachments included with the message, notnull; copied, so later changes to the given list do not affect the event- Throws:
NullPointerException- ifuserMessage,messageIdorattachmentsisnull, orattachmentscontainsnullelements- Since:
- 25.3
-
-
Method Details
-
getUserMessage
Gets the user message being submitted to the LLM.- Returns:
- the user message, never
null
-
getMessageId
Gets the unique identifier assigned to this message. The same id is available viaChatMessage.messageId()in the conversation history and viaAttachmentClickListener.AttachmentClickEvent.getMessageId()on attachment click.- Returns:
- the message id, never
null
-
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
-