Interface ChatModelStreamingEvent

All Known Subinterfaces:
RawStreamingEvent
All Known Implementing Classes:
CompleteResponse, CompleteToolCall, PartialResponse, PartialThinking, PartialToolCall

@Experimental public interface ChatModelStreamingEvent
Base type for the events emitted by the reactive stream of a StreamingChatModel — the Flow.Publisher<ChatModelStreamingEvent> returned by StreamingChatModel.chat(dev.langchain4j.model.chat.request.ChatRequest).

This is the low-level, per-model-call vocabulary: the streamed chunks of a single model response (PartialResponse, PartialThinking, PartialToolCall), the assembled CompleteToolCalls, any provider-specific RawStreamingEvent, and finally exactly one CompleteResponse carrying the full ChatResponse, emitted last right before the stream completes. The higher-level, whole-interaction counterpart (token chunks of every round, the tool-execution lifecycle, RAG content, intermediate vs. final answer) is dev.langchain4j.service.AiServiceStreamingEvent.

The set is intentionally not sealed: new event types may be added over time, so consumers must handle unrecognized subtypes gracefully (e.g. a default branch in a type switch) rather than assume it is exhaustive.

Since:
1.20.0