Polyman Documentation - v3.1.0
    Preparing search index...

    Function toWireMessages

    • Maps our messages to the Messages format.

      • 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.

      Parameters

      Returns WireMessage[]