Assistant parts keep their order: thinking, text and tool_use blocks.
Reasoning goes back only when it has a signature (or redacted data),
unchanged, since the API needs the thinking blocks of earlier turns.
Reasoning from other providers has no signature and is dropped.
Tool results become tool_result blocks in a user message, before any
text of that message.
Messages of the same role next to each other are joined into one.
Maps our messages to the Messages format.
tool_useblocks. Reasoning goes back only when it has a signature (or redacted data), unchanged, since the API needs the thinking blocks of earlier turns. Reasoning from other providers has no signature and is dropped.tool_resultblocks in ausermessage, before any text of that message.