langchain_core.outputs.chat_generation.ChatGenerationChunk

class langchain_core.outputs.chat_generation.ChatGenerationChunk[source]

Bases: ChatGeneration

ChatGeneration chunk, which can be concatenated with other

ChatGeneration chunks.

message

The message chunk output by the chat model.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

param generation_info: Optional[Dict[str, Any]] = None

Raw response from the provider.

May include things like the reason for finishing or token log probabilities.

param message: BaseMessageChunk [Required]

The message output by the chat model.

param text: str = ''

SHOULD NOT BE SET DIRECTLY The text contents of the output message.

param type: Literal['ChatGenerationChunk'] = 'ChatGenerationChunk'

Type is used exclusively for serialization purposes.

Examples using ChatGenerationChunk