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 }).bind({ stop: ["</tool_input>", "</final_answer>"], }), new XMLAgentOutputParser(),]);const result = await executor.invoke({ input: "What is the weather in Honolulu?", tools: [],}); Copy
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 }).bind({ stop: ["</tool_input>", "</final_answer>"], }), new XMLAgentOutputParser(),]);const result = await executor.invoke({ input: "What is the weather in Honolulu?", tools: [],});
Parses the output text from the agent and returns an AgentAction or AgentFinish object.
The output text from the agent.
An AgentAction or AgentFinish object.
Generated using TypeDoc
Example