Class: LlamaGrammar
Extended by
Constructors
new LlamaGrammar()
ts
new LlamaGrammar(llama: Llama, options: LlamaGrammarOptions): LlamaGrammar
GBNF files are supported. More info here: github:ggerganov/llama.cpp:grammars/README.md
Parameters
Parameter | Type | Description |
---|---|---|
llama | Llama | |
options | LlamaGrammarOptions |
Returns
Defined in
Accessors
grammar
ts
get grammar(): string
Returns
string
Defined in
rootRuleName
ts
get rootRuleName(): string
Returns
string
Defined in
stopGenerationTriggers
ts
get stopGenerationTriggers(): readonly (string | LlamaText | readonly (string | Token)[])[]
Returns
readonly (string
| LlamaText
| readonly (string
| Token
)[])[]
Defined in
trimWhitespaceSuffix
ts
get trimWhitespaceSuffix(): boolean
Returns
boolean
Defined in
Methods
getFor()
ts
static getFor(llama: Llama, type:
| "json"
| "json_arr"
| "list"
| "c"
| "arithmetic"
| "japanese"
| "chess"): Promise<LlamaGrammar>
Parameters
Parameter | Type |
---|---|
llama | Llama |
type | | "json" | "json_arr" | "list" | "c" | "arithmetic" | "japanese" | "chess" |