langchain.schema.output.ChatGenerationChunk¶
- class langchain.schema.output.ChatGenerationChunk(*, text: str = '', generation_info: Optional[Dict[str, Any]] = None, message: BaseMessageChunk)[source]¶
Bases:
ChatGenerationCreate 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: langchain.schema.messages.BaseMessageChunk [Required]¶
The message output by the chat model.
- param text: str = ''¶
SHOULD NOT BE SET DIRECTLY The text contents of the output message.
- validator set_text » all fields¶
Set the text attribute to be the contents of the message.
- to_json() Union[SerializedConstructor, SerializedNotImplemented]¶
- to_json_not_implemented() SerializedNotImplemented¶
- property lc_attributes: Dict¶
Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor.
- property lc_namespace: List[str]¶
Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”]
- property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”}
- property lc_serializable: bool¶
Whether this class is LangChain serializable.