Class ResponseListener.ResponseEvent

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

public static class ResponseListener.ResponseEvent extends Object implements Serializable
Event fired after the assistant's stream has completed, on success or failure.
See Also:
  • Method Details

    • getResponse

      public String getResponse()
      Gets the assistant's response text. On success this is the full text (may be empty when the model emitted only tool calls); on failure this is whatever partial stream was received before the error, possibly empty.
      Returns:
      the response text, never null
    • getError

      public Optional<Throwable> getError()
      Gets the failure cause if the turn ended with an error. Returns an empty optional on a successful turn.
      Returns:
      the failure cause, or empty on success