Skip to content

Type Alias: LlamaGrammarOptions ​

ts
type LlamaGrammarOptions = {
  grammar: string;
  stopGenerationTriggers?: readonly (LlamaText | string | readonly (string | Token)[])[];
  trimWhitespaceSuffix?: boolean;
  rootRuleName?: string;
};

Defined in: evaluator/LlamaGrammar.ts:10

Properties ​

grammar ​

ts
grammar: string;

Defined in: evaluator/LlamaGrammar.ts:12

GBNF grammar


stopGenerationTriggers? ​

ts
optional stopGenerationTriggers: readonly (LlamaText | string | readonly (string | Token)[])[];

Defined in: evaluator/LlamaGrammar.ts:15

Consider any of these as EOS for the generated text. Only supported by LlamaChat and LlamaChatSession


trimWhitespaceSuffix? ​

ts
optional trimWhitespaceSuffix: boolean;

Defined in: evaluator/LlamaGrammar.ts:18

Trim whitespace from the end of the generated text. Only supported by LlamaChat and LlamaChatSession


rootRuleName? ​

ts
optional rootRuleName: string;

Defined in: evaluator/LlamaGrammar.ts:25

Root rule name.

Defaults to "root".