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-coreloaddumpdumps
    Function●Since v0.1

    dumps

    Return a JSON string representation of an object.

    Copy
    dumps(
      obj: Any,
      *,
      pretty: bool = False,
      **kwargs: Any = {}
    ) -> str

    Note:

    Plain dicts containing an 'lc' key are automatically escaped to prevent confusion with LC serialization format. The escape marker is removed during deserialization.

    Parameters

    NameTypeDescription
    obj*Any

    The object to dump.

    prettybool
    Default:False

    Whether to pretty print the json.

    If True, the json will be indented by either 2 spaces or the amount provided in the indent kwarg.

    **kwargsAny
    Default:{}

    Additional arguments to pass to json.dumps

    View source on GitHub