Method CreateJsonGrammarFromJsonScheme
- Namespace
- LMKit.TextGeneration.Sampling
- Assembly
- LM-Kit.NET.dll
CreateJsonGrammarFromJsonScheme(string)
Creates a new instance of the Grammar class based on a given JSON schema.
public static Grammar CreateJsonGrammarFromJsonScheme(string json)
Parameters
json
stringA string containing a JSON schema. The schema defines the structure of the JSON data, including field names and their associated types.
Returns
Exceptions
- ArgumentException
Thrown if the
json
string is null, empty, or not a valid JSON schema. This exception indicates that a valid JSON schema is required to create a Grammar instance.