langchain.js
    Preparing search index...

    Class that represents an agent that uses XML tags.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    lc_namespace: string[] = ...
    llmChain: LLMChain
    outputParser: XMLAgentOutputParser = ...
    tools: ToolInterface[]
    ToolType: StructuredToolInterface

    Accessors

    • get allowedTools(): undefined | string[]

      Returns undefined | string[]

    • get inputKeys(): string[]

      Returns string[]

    • get returnValues(): string[]

      Returns string[]

    Methods

    • Return the string type key uniquely identifying multi or single action agents.

      Returns string

    • Return the string type key uniquely identifying this class of agent.

      Returns "xml"

    • Plans the next action or finish state of the agent based on the provided steps, inputs, and optional callback manager.

      Parameters

      • steps: AgentStep[]

        The steps to consider in planning.

      • inputs: ChainValues

        The inputs to consider in planning.

      • OptionalcallbackManager: any

        Optional CallbackManager to use in planning.

      Returns Promise<any>

      A Promise that resolves to an AgentAction or AgentFinish object representing the planned action or finish state.

    • Prepare the agent for output, if needed

      Parameters

      • _returnValues: AgentFinish
      • _steps: AgentStep[]

      Returns Promise<AgentFinish>

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

      Parameters

      • earlyStoppingMethod: StoppingMethod
      • _steps: AgentStep[]
      • _inputs: ChainValues
      • Optional_callbackManager: any

      Returns Promise<AgentFinish>

    • Returns any

    • Creates an XMLAgent from a BaseLanguageModel and a list of tools.

      Parameters

      • llm: BaseLanguageModelInterface

        The BaseLanguageModel to use.

      • tools: ToolInterface[]

        The tools to be used by the agent.

      • Optionalargs: XMLAgentInput & Pick<AgentArgs, "callbacks">

        Optional arguments for creating the agent.

      Returns XMLAgent

      An instance of XMLAgent.

    • Returns string