llama.rn / SchemaGrammarConverter
- _addPrimitive
- _addRule
- _buildObjectRule
- _generateUnionRule
- _resolveRef
- _visitPattern
- formatGrammar
- resolveRefs
- visit
• new SchemaGrammarConverter(options
)
Name | Type |
---|---|
options |
Object |
options.allow_fetch? |
boolean |
options.dotall? |
boolean |
options.prop_order? |
SchemaGrammarConverterPropOrder |
• Private
_allowFetch: boolean
• Private
_dotall: boolean
• Private
_propOrder: SchemaGrammarConverterPropOrder
• Private
_refs: Object
▪ [key: string
]: any
• Private
_refsBeingResolved: Set
<string
>
• Private
_rules: Object
▪ [key: string
]: string
▸ _addPrimitive(name
, rule
): string
Name | Type |
---|---|
name |
string |
rule |
undefined | SchemaGrammarConverterBuiltinRule |
string
▸ _addRule(name
, rule
): string
Name | Type |
---|---|
name |
string |
rule |
string |
string
▸ _buildObjectRule(properties
, required
, name
, additionalProperties
): string
Name | Type |
---|---|
properties |
any [] |
required |
Set <string > |
name |
string |
additionalProperties |
any |
string
▸ _generateUnionRule(name
, altSchemas
): string
Name | Type |
---|---|
name |
string |
altSchemas |
any [] |
string
▸ _resolveRef(ref
): string
Name | Type |
---|---|
ref |
string |
string
▸ _visitPattern(pattern
, name
): string
Name | Type |
---|---|
pattern |
string |
name |
string |
string
▸ formatGrammar(): string
string
▸ resolveRefs(schema
, url
): Promise
<any
>
Name | Type |
---|---|
schema |
any |
url |
string |
Promise
<any
>
▸ visit(schema
, name
): string
Name | Type |
---|---|
schema |
any |
name |
string |
string