Format the intermediate steps as XML.
Create an agent that uses XML to format its logic.
Base Single Action Agent class.
Parses tool invocations and final answers from XML-formatted agent output.
This parser extracts structured information from XML tags to determine whether an agent should perform a tool action or provide a final answer. It includes built-in escaping support to safely handle tool names and inputs containing XML special characters.
Agent that uses XML tags.
Chain to run queries against LLMs.
This class is deprecated. See below for an example implementation using LangChain runnables:
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import PromptTemplate
from langchain_openai import OpenAI
prompt_template = "Tell me a {adjective} joke"
prompt = PromptTemplate(input_variables=["adjective"], template=prompt_template)
model = OpenAI()
chain = prompt | model | StrOutputParser()
chain.invoke("your adjective here")