Skip to content

Class: LlamaGrammarEvaluationState ​

Defined in: evaluator/LlamaGrammarEvaluationState.ts:19

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 ​

Constructor ​

Defined in: evaluator/LlamaGrammarEvaluationState.ts:23

Parameters ​

ParameterType
optionsLlamaGrammarEvaluationStateOptions

Returns ​

LlamaGrammarEvaluationState

Constructor ​

Defined in: evaluator/LlamaGrammarEvaluationState.ts:24

Parameters ​

ParameterType
existingStateLlamaGrammarEvaluationState

Returns ​

LlamaGrammarEvaluationState

Methods ​

clone() ​

Defined in: evaluator/LlamaGrammarEvaluationState.ts:41

Clone the grammar evaluation state

Returns ​

LlamaGrammarEvaluationState