LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-classicagentsformat_scratchpadxmlformat_xml
    Function●Since v1.0

    format_xml

    Format the intermediate steps as XML.

    Copy
    format_xml(
      intermediate_steps: list[tuple[AgentAction, str]],
      *,
      escape_format: Literal['minimal'] | None = 'minimal'
    ) -> str

    Parameters

    NameTypeDescription
    intermediate_steps*list[tuple[AgentAction, str]]

    The intermediate steps.

    escape_formatLiteral['minimal'] | None
    Default:'minimal'

    The escaping format to use. Currently only 'minimal' is supported, which replaces XML tags with custom delimiters to prevent conflicts.

    View source on GitHub