LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-coremessageschatChatMessageChunk
    Class●Since v0.1

    ChatMessageChunk

    Chat Message chunk.

    Copy
    ChatMessageChunk(
      self,
      content: str | list[str | dict] | None = None,
      content_blocks: list[types.ContentBlock] | None = None,
      **kwargs: Any = {}
    )

    Bases

    ChatMessageBaseMessageChunk

    Attributes

    attribute
    type: Literal['ChatMessageChunk']

    The type of the message (used during serialization).

    Inherited fromChatMessage

    Attributes

    Arole: str
    —

    The speaker / role of the Message.

    Inherited fromBaseMessage

    Attributes

    Acontent: str | list[str | dict]
    —

    The contents of the message.

    Aadditional_kwargs: dict
    —

    Currently inherited from BaseMessage, but not used.

    Aresponse_metadata: dict
    —

    Currently inherited from BaseMessage, but not used.

    Aname: str
    —

    The name of the function.

    Aid: str
    —

    The unique identifier of the node.

    Amodel_configAcontent_blocks: list[types.ContentBlock]
    —

    Return standard, typed ContentBlock dicts from the message.

    Atext: str
    —

    Prompt text.

    Methods

    Mis_lc_serializable
    —

    Return True as this class is serializable.

    Mget_lc_namespace
    —

    Get the namespace of the LangChain object.

    Mpretty_repr
    —

    Return a pretty representation of the message for display.

    Mpretty_print
    —

    Print a pretty representation of the message.

    Inherited fromSerializable

    Attributes

    Alc_secrets: dict[str, str]
    —

    A map of constructor argument names to secret ids.

    Alc_attributes: dict
    —

    List of attribute names that should be included in the serialized kwargs.

    Amodel_config

    Methods

    Mis_lc_serializable
    —

    Return True as this class is serializable.

    Mget_lc_namespace
    —

    Get the namespace of the LangChain object.

    Mlc_id
    —

    Return a unique identifier for this class for serialization purposes.

    Mto_json
    —

    Convert the graph to a JSON-serializable format.

    Mto_json_not_implemented
    —

    Serialize a "not implemented" object.

    View source on GitHub