openai.internal._strict
(internal) `schema`, from `baml.json.schema`, rewritten to the subset OpenAI's strict mode accepts:
Reference version
Signature
function openai.internal._strict(
schema: baml.json.json,
type_name: string,
provider: string
) -> baml.json.json throws ai.errors.InvalidRequest
(internal) schema, from baml.json.schema, rewritten to the subset OpenAI's strict
mode accepts:
- every object lists all its properties in
requiredand setsadditionalProperties: false. A property that may be absent is one whose schema already admitsnull, and strict mode spells "optional" exactly that way; - a
$refwith adescriptionbeside it becomes a one-memberanyOf, because strict mode rejects keywords beside$ref; - a map (an object with schema-valued
additionalProperties, orpropertyNames) is rejected: strict mode has no form for one.
Only the keywords that hold schemas are walked. enum and const hold
values, and are copied as they are.
Source:<builtin>/openai/ns_internal/structured.bamlbytes 6259–9324