lloyal-agents API Reference
    Preparing search index...

    Interface GrammarTrigger

    Grammar trigger from format-aware chat template

    Defines conditions for lazy grammar activation. When grammarLazy is true in FormattedChatResult, generation runs unconstrained until one of these triggers fires, at which point the grammar is activated.

    interface GrammarTrigger {
        token: number;
        type: GrammarTriggerType;
        value: string;
    }
    Index

    Properties

    Properties

    token: number

    Token ID (for TOKEN-type triggers, -1 when not applicable)

    Trigger type

    value: string

    Trigger value (token text, word, or regex pattern depending on type)