Member Junction
    Preparing search index...

    Function createToolResultMessage

    • Builds the tool turn that answers one or more tool calls.

      Providers require the results for a given assistant turn's calls to arrive TOGETHER, in the single turn that immediately follows it — so pass every result for that turn in one call rather than appending a message per result.

      Parameters

      • results: { content: string; isError?: boolean; toolCallId: string; toolName?: string }[]

        One entry per tool call being answered

      Returns ChatMessage

      A tool-role message whose content is the corresponding tool_result blocks