langchain.agents.format_scratchpad.log_to_messages.format_log_to_messagesΒΆ

langchain.agents.format_scratchpad.log_to_messages.format_log_to_messages(intermediate_steps: List[Tuple[AgentAction, str]], template_tool_response: str = '{observation}') List[BaseMessage][source]ΒΆ

Construct the scratchpad that lets the agent continue its thought process.

Parameters
  • intermediate_steps (List[Tuple[AgentAction, str]]) – List of tuples of AgentAction and observation strings.

  • template_tool_response (str) – Template to format the observation with. Defaults to β€œ{observation}”.

Returns

The scratchpad.

Return type

List[BaseMessage]