Interface AiServiceCancelledEvent

All Superinterfaces:
AiServiceEvent
All Known Implementing Classes:
DefaultAiServiceCancelledEvent

@Experimental public interface AiServiceCancelledEvent extends AiServiceEvent
Invoked when an AI Service invocation is cancelled before it completes, for example when the Flow.Publisher subscription is cancelled, the returned CompletableFuture is cancelled, or StreamingHandle.cancel() is called from a TokenStream callback that receives a context, such as onPartialResponseWithContext. It means that cancellation was requested: the model provider or a tool may still finish work that was already running. A cancelled invocation fires neither AiServiceCompletedEvent nor AiServiceErrorEvent. Events of work that was already running when the invocation was cancelled (for example a ToolExecutedEvent) can still arrive after this event.
Since:
1.23.0