OpenAIJsonSchema
Namespace: Vercel.AI.OpenAI
public static class OpenAIJsonSchemaRemoves JSON Schema keywords OpenAI does not enforce: string propertyNames
and regex lookaround in pattern.
Inheritance: object
Fields
Section titled “Fields”LookaroundDetails
Section titled “LookaroundDetails”public const string LookaroundDetails = "OpenAI does not support regex lookaround in JSON Schema patterns. The pattern was removed before sending the schema, so OpenAI will not enforce that constraint."The warning OpenAI emits when a lookaround pattern is removed.
Value: string
PropertyNamesDetails
Section titled “PropertyNamesDetails”public const string PropertyNamesDetails = "OpenAI does not support JSON Schema propertyNames. It was removed before sending the schema, so OpenAI will not enforce property-name constraints."The warning OpenAI emits when propertyNames is removed.
Value: string
Methods
Section titled “Methods”ContainsRegexLookaround(string)
Section titled “ContainsRegexLookaround(string)”public static bool ContainsRegexLookaround(string pattern)True when <code class=“paramref”>pattern</code> contains an unescaped regex lookaround.
Parameters
| Name | Type | Description |
|---|---|---|
pattern |
string |
Returns: bool
Normalize(JsonElement)
Section titled “Normalize(JsonElement)”public static OpenAIJsonSchemaResult Normalize(JsonElement schema)Returns a copy of <code class=“paramref”>schema</code> safe to send to OpenAI.
Parameters
| Name | Type | Description |
|---|---|---|
schema |
JsonElement |
Returns: OpenAIJsonSchemaResult
Normalize(JsonNode)
Section titled “Normalize(JsonNode)”public static OpenAIJsonSchemaResult Normalize(JsonNode schema)Returns a copy of <code class=“paramref”>schema</code> safe to send to OpenAI.
Parameters
| Name | Type | Description |
|---|---|---|
schema |
JsonNode |
Returns: OpenAIJsonSchemaResult
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product