Message chunk from an AI (yielded when streaming).
AIMessageChunk(
self,
content: str | list[str | dict] | None = None,
content_blocks: list[types.ContentBlock] | None = None,
**kwargs: Any = {}
)The type of the message (used for deserialization).
If provided, tool call chunks associated with the message.
Optional span represented by an aggregated AIMessageChunk.
If a chunk with chunk_position="last" is aggregated into a stream,
tool_call_chunks in message content will be parsed into tool_calls.
Return standard, typed ContentBlock dicts from the message.
The contents of the message.
Currently inherited from BaseMessage, but not used.
Currently inherited from BaseMessage, but not used.
The name of the function.
The unique identifier of the node.
Prompt text.
Return True as this class is serializable.
Get the namespace of the LangChain object.
Return a unique identifier for this class for serialization purposes.
Convert the graph to a JSON-serializable format.
Serialize a "not implemented" object.