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

    Chat LangChain

    What can I help with?

    Enter to sendยทShift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-coremessagesbasemerge_content
    Functionโ—Since v1.8

    merge_content

    Copy
    merge_content(
      first_content: str | list[str | dict[Any,
    View source on GitHub
    Any
    ]
    ]
    ,
    contents
    :
    str
    |
    list
    [
    str
    |
    dict
    [
    Any
    ,
    Any
    ]
    ]
    =
    (
    )
    )
    ->
    str
    |
    list
    [
    str
    |
    dict
    [
    Any
    ,
    Any
    ]
    ]

    Parameters

    NameTypeDescription
    first_content*str | list[str | dict[Any, Any]]

    The first content. Can be a string or a list.

    contentsstr | list[str | dict[Any, Any]]
    Default:()

    Merge multiple message contents.

    The other contents. Can be a string or a list.