lloyal-agents API Reference
    Preparing search index...

    Function buildToolResultDelta

    • Build a token delta for a tool result turn

      Composes getTurnSeparator() + formatChatSync() + tokenizeSync() into a single token array suitable for branch.prefill(). Used by useAgentPool to inject tool results back into agent context.

      Parameters

      • ctx: SessionContext

        Active session context

      • resultStr: string

        JSON-serialized tool result

      • callId: string

        Tool call identifier from the model's parsed output

      Returns number[]

      Token array ready for branch.prefill()