Table of Contents

Property Grammar

Namespace
LMKit.TextGeneration
Assembly
LM-Kit.NET.dll

Grammar

Grammar rules used to constrain model output (e.g., to produce valid JSON). When set to non-null, repetition penalties are disabled by default to prevent conflicts. With tools: when tools are registered in Tools, the grammar governs the final answer only. A turn runs its tool calls unconstrained (a grammar cannot let a call interrupt it), then generates the answer under the grammar from the same history; the answer the tool phase ended with is a draft, discarded, and StructuredAnswerStarting marks the switch.

public Grammar Grammar { get; set; }

Property Value

Grammar
Share