Interface ResponseCompleteListener

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 ResponseCompleteListener extends Serializable
Listener for LLM response completion events.

The listener is called after each successful exchange — when the assistant's response has been fully streamed and added to the conversation history. This is the recommended hook for persisting conversation state (via AIOrchestrator.getHistory()), triggering follow-up actions, or updating UI elements.

The listener is not called when:

  • The LLM response fails with an error or times out
  • The assistant response is empty
  • History is restored via Builder.withHistory()

Threading: This listener is called from a background thread (Reactor scheduler). It is safe to perform blocking I/O (e.g. database writes) directly. To update Vaadin UI components from this listener, use ui.access().

  • Method Details

    • onResponseComplete

      void onResponseComplete(ResponseCompleteListener.ResponseCompleteEvent event)
      Called when the assistant's response has been fully streamed and recorded in the conversation history.
      Parameters:
      event - the response complete event