Class RequestInterceptor.RequestContinuation

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

public static final class RequestInterceptor.RequestContinuation extends Object implements Serializable
Handle for completing a prompt postponed via RequestInterceptor.RequestInterceptEvent.postpone(Duration). Complete it from any thread; completion is first-wins — once the prompt has proceeded, failed, or timed out, later completions are ignored.
See Also:
  • Method Details

    • proceed

      public void proceed()
      Resumes the postponed prompt with the event's current content. The event must not be changed afterwards. A no-op when the prompt has already been completed or timed out.
    • fail

      public void fail(Throwable cause)
      Aborts the postponed prompt: nothing is sent or shown, and the cause is reported to the ResponseListener and AIController.onResponse(Throwable). Safe to call when the UI is already detached: the ResponseListener is still notified, only the UI-bound controller hook is skipped. A no-op when the prompt has already been completed or timed out.
      Parameters:
      cause - the failure to report, not null
      Throws:
      NullPointerException - if cause is null