Method CreateJsonGrammarFromTextFields
- Namespace
- LMKit.TextGeneration.Sampling
- Assembly
- LM-Kit.NET.dll
CreateJsonGrammarFromTextFields(IEnumerable<string>)
Creates a new instance of the Grammar class based on a collection of JSON text field names.
public static Grammar CreateJsonGrammarFromTextFields(IEnumerable<string> fields)
Parameters
fields
IEnumerable<string>A collection of strings representing the names of the JSON text fields. Each string in the collection corresponds to a field name in the JSON structure that will be used to define the Grammar.
Returns
Exceptions
- ArgumentException
Thrown if the
fields
collection is null or empty. This exception indicates that the method requires at least one field name to create a valid Grammar instance.