Skip to content

Class: LlamaGrammarEvaluationState

Constructors

new LlamaGrammarEvaluationState(options)

ts
new LlamaGrammarEvaluationState(options): LlamaGrammarEvaluationState
new LlamaGrammarEvaluationState(options): 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, as LlamaChatSession already handles this for you.

Parameters

ParameterTypeDescription
optionsLlamaGrammarEvaluationStateOptions

Source

llamaEvaluator/LlamaGrammarEvaluationState.ts:20