Logic for formatting intermediate steps into an agent scratchpad.
Intermediate steps refers to the list of (AgentAction, observation) tuples that result from previous iterations of the agent. Depending on the prompting strategy you are using, you may want to format these differently before passing them into the LLM.
Construct the scratchpad that lets the agent continue its thought process.
Construct the scratchpad that lets the agent continue its thought process.
Convert (AgentAction, tool output) tuples into FunctionMessages.
Convert (AgentAction, tool output) tuples into ToolMessage objects.
Format the intermediate steps as XML.