# format_log_to_messages

> **Function** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/agents/format_scratchpad/log_to_messages/format_log_to_messages)

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

## Signature

```python
format_log_to_messages(
    intermediate_steps: list[tuple[AgentAction, str]],
    template_tool_response: str = '{observation}',
) -> list[BaseMessage]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `intermediate_steps` | `list[tuple[AgentAction, str]]` | Yes | List of tuples of AgentAction and observation strings. |
| `template_tool_response` | `str` | No | Template to format the observation with. Defaults to `"{observation}"`. (default: `'{observation}'`) |

## Returns

`list[BaseMessage]`

The scratchpad.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/c59e83a1ffba63d709ea4847445845edd82085dc/libs/langchain/langchain_classic/agents/format_scratchpad/log_to_messages.py#L5)