langchain.js
    Preparing search index...
    const prompt = ChatPromptTemplate.fromMessages([
    HumanMessagePromptTemplate.fromTemplate(AGENT_INSTRUCTIONS),
    new MessagesPlaceholder("agent_scratchpad"),
    ]);
    const runnableAgent = RunnableSequence.from([
    ...rest of runnable
    prompt,
    new ChatAnthropic({ modelName: "claude-2", temperature: 0 }).withConfig({
    stop: ["</tool_input>", "</final_answer>"],
    }),
    new XMLAgentOutputParser(),
    ]);
    const result = await executor.invoke({
    input: "What is the weather in Honolulu?",
    tools: [],
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    lc_namespace: string[] = ...

    Methods

    • Returns string

    • Parses the output text from the agent and returns an AgentAction or AgentFinish object.

      Parameters

      • text: string

        The output text from the agent.

      Returns Promise<any>

      An AgentAction or AgentFinish object.

    • Returns string