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-classicagentsxmlbaseXMLAgent
    Class●Since v1.0Deprecated

    XMLAgent

    Agent that uses XML tags.

    Copy
    XMLAgent()

    Bases

    BaseSingleActionAgent

    Parameters

    NameTypeDescription
    tools*unknown

    list of tools the agent can choose from

    llm_chain*unknown

    The LLMChain to call to predict the next action

    Attributes

    attribute
    tools: list[BaseTool]

    List of tools this agent has access to.

    attribute
    llm_chain: LLMChain

    Chain to use to predict action.

    attribute
    input_keys: list[str]

    Methods

    method
    get_default_prompt

    Return the default prompt for the XML agent.

    method
    get_default_output_parser

    Return an XMLAgentOutputParser.

    method
    plan
    method
    aplan

    Inherited fromBaseSingleActionAgent

    Attributes

    Areturn_values: list[str]
    —

    Return values of the agent.

    Methods

    Mget_allowed_tools
    —

    Get allowed tools.

    Mreturn_stopped_response
    —

    Return response when agent has been stopped due to max iterations.

    Mfrom_llm_and_tools
    —

    Construct an agent from an LLM and tools.

    Mdict
    —

    Return dictionary representation of agent.

    Msave
    —

    Save the agent.

    Mtool_run_logging_kwargs
    —

    Return logging kwargs for tool run.

    View source on GitHub