AgentExecutor chain...     <tool>search</tool>    <tool_input>weather in new york32 degrees <tool>search</tool>    <tool_input>weather in new york32 degrees <final_answer>    The weather in New York is 32 degrees.    </final_answer>        > Finished chain.    {'question': 'whats the weather in New york?',     'output': '\nThe weather in New York is 32 degrees.\n'}Use off-the-shelf agent‚Äãfrom langchain.chains import LLMChainfrom langchain.agents import XMLAgentchain = LLMChain(    llm=model,    prompt=XMLAgent.get_default_prompt(),    output_parser=XMLAgent.get_default_output_parser())agent = XMLAgent(tools=tools, llm_chain=chain)agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)agent_executor.invoke({"input": "whats the weather in New york?"})            > Entering new AgentExecutor chain...     <tool>search</tool>    <tool_input>weather in new york32 degrees        <final_answer>The weather in New York is 32 degrees        > Finished chain.    {'input': 'whats the weather in New york?',     'output': 'The weather in New York is 32 degrees'}PreviousStructured tool chatNextAdd Memory to OpenAI Functions AgentInitialize the toolsUse LangChain Expression LanguageUse off-the-shelf agentCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
Some language models (like Anthropic's Claude) are particularly good at reasoning/writing XML. This goes over how to use an agent that uses XML when prompting.
Some language models (like Anthropic's Claude) are particularly good at reasoning/writing XML. This goes over how to use an agent that uses XML when prompting. ->: AgentExecutor chain...     <tool>search</tool>    <tool_input>weather in new york32 degrees <tool>search</tool>    <tool_input>weather in new york32 degrees <final_answer>    The weather in New York is 32 degrees.    </final_answer>        > Finished chain.    {'question': 'whats the weather in New york?',     'output': '\nThe weather in New York is 32 degrees.\n'}Use off-the-shelf agent‚Äãfrom langchain.chains import LLMChainfrom langchain.agents import XMLAgentchain = LLMChain(    llm=model,    prompt=XMLAgent.get_default_prompt(),    output_parser=XMLAgent.get_default_output_parser())agent = XMLAgent(tools=tools, llm_chain=chain)agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)agent_executor.invoke({"input": "whats the weather in New york?"})            > Entering new AgentExecutor chain...     <tool>search</tool>    <tool_input>weather in new york32 degrees        <final_answer>The weather in New York is 32 degrees        > Finished chain.    {'input': 'whats the weather in New york?',     'output': 'The weather in New York is 32 degrees'}PreviousStructured tool chatNextAdd Memory to OpenAI Functions AgentInitialize the toolsUse LangChain Expression LanguageUse off-the-shelf agentCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.