Interface RequestListener

All Superinterfaces:
Serializable
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface RequestListener extends Serializable
Listener for request submission events.

The listener is called on every prompt, just before the LLM stream opens — the same lifecycle moment as AIController.onRequest(). Use it to persist the outbound request (the user message, any attachments) or to correlate the assigned messageId with downstream events such as AttachmentClickListener and the messageId stored in ChatMessage.messageId().

Threading: the listener is called on the UI thread under the session lock. Long-running work should be offloaded to a worker; UI updates do not need an extra ui.access(...) hop.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Event fired just before the LLM stream opens for a prompt.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called just before the LLM stream opens for a prompt.
  • Method Details

    • onRequest

      void onRequest(RequestListener.RequestEvent event)
      Called just before the LLM stream opens for a prompt.
      Parameters:
      event - the request event