format_to_tool_messages#

langchain.agents.format_scratchpad.tools.format_to_tool_messages(intermediate_steps: Sequence[Tuple[AgentAction, str]]) List[BaseMessage][source]#

Convert (AgentAction, tool output) tuples into ToolMessages.

Parameters:

intermediate_steps (Sequence[Tuple[AgentAction, str]]) – Steps the LLM has taken to date, along with observations.

Returns:

list of messages to send to the LLM for the next prediction.

Return type:

List[BaseMessage]