lloyal-agents API Reference
    Preparing search index...

    Function buildUserDelta

    • Build a token delta for a user turn

      Composes getTurnSeparator() + formatChatSync() + tokenizeSync() into a single token array suitable for branch.prefill(). Usable with any branch — not tied to Session's trunk.

      This is the canonical way to build a user-turn delta for warm prefill in multi-turn conversations.

      Parameters

      • ctx: SessionContext

        Active session context

      • content: string

        User message content

      • opts: { tools?: string } = {}

        Optional tools JSON for tool-aware formatting

      Returns number[]

      Token array ready for branch.prefill()