Skip to content

Class: LlamaGrammarEvaluationState

Grammar evaluation state is used to track the model response to determine the next allowed characters for the model to generate.

Create a new grammar evaluation state for every response you generate with the model.

This is only needed when using the LlamaContext class directly, since LlamaChatSession already handles this for you.

Constructors

new LlamaGrammarEvaluationState()

ts
new LlamaGrammarEvaluationState(options: LlamaGrammarEvaluationStateOptions): LlamaGrammarEvaluationState

Parameters

ParameterTypeDescription
optionsLlamaGrammarEvaluationStateOptions

Returns

LlamaGrammarEvaluationState

Defined in

evaluator/LlamaGrammarEvaluationState.ts:26