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

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    Standard Tests
    Text Splitters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Language
    Theme
    Pythonlangchain-classicagentsxmlbase
    Moduleā—Since v1.0

    base

    Attributes

    Functions

    Classes

    View source on GitHub
    attribute
    agent_instructions: str
    function
    format_xml
    function
    create_xml_agent
    class
    BaseSingleActionAgent
    class
    XMLAgentOutputParser
    deprecatedclass
    LLMChain
    deprecatedclass
    XMLAgent

    Format the intermediate steps as XML.

    Create an agent that uses XML to format its logic.

    Base Single Action Agent class.

    Parses tool invocations and final answers from XML-formatted agent output.

    This parser extracts structured information from XML tags to determine whether an agent should perform a tool action or provide a final answer. It includes built-in escaping support to safely handle tool names and inputs containing XML special characters.

    Agent that uses XML tags.

    Chain to run queries against LLMs.

    This class is deprecated. See below for an example implementation using LangChain runnables:

    from langchain_core.output_parsers import StrOutputParser
    from langchain_core.prompts import PromptTemplate
    from langchain_openai import OpenAI
    
    prompt_template = "Tell me a {adjective} joke"
    prompt = PromptTemplate(input_variables=["adjective"], template=prompt_template)
    model = OpenAI()
    chain = prompt | model | StrOutputParser()
    
    chain.invoke("your adjective here")