Streaming Chat Complete Response (response/CompleteResponse.java)

langchain4j · langchain4j-core/src/main/java/dev/langchain4j/model/chat/response/CompleteResponse.java · java · Apache-2.0
ai, realtime, chat, lang:java, tag:knn-classified, tag:response

Terminal streaming chat event carrying the aggregated ChatResponse, emitted last after all partial chunks. Reuse when handling final results from streaming chat models.

// Source: https://github.com/langchain4j/langchain4j | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package dev.langchain4j.model.chat.response;

import static dev.langchain4j.internal.ValidationUtils.ensureNotNull;

import dev.langchain4j.Experimental;
import dev.langchain4j.internal.JacocoIgnoreCoverageGenerated;

import java.util.Objects;

/**
 * The terminal {@link ChatModelStreamingEvent} of a streaming chat: the complete, aggregated {@link ChatResponse}.
 * It is the streaming counterpart of {@link PartialResponse} (a single text chunk) — emitted once, last,
 * after all partial events.
 * <p>
 * Wrapping {@link ChatResponse} (rather than having it implement {@link ChatMod

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key