ai.internal._schema_for_signature
(internal) One JSON Schema object for a function's parameters, derived from the signature: every parameter typed via baml.json.schema.
Reference version
Signature
function ai.internal._schema_for_signature(
handler: reflect.AnyFunction<Returns = unknown, Throws = unknown>
) -> map<string, unknown> throws baml.errors.Unsupported | baml.json.DecodeError
(internal) One JSON Schema object for a function's parameters, derived from the signature: every parameter typed via baml.json.schema.
baml.json.schema puts the classes and aliases a type reaches in $defs
at the root of the schema it returns, and its $refs point there
(#/$defs/Name). A parameter's schema is a property of this object, so
its $defs move to this object's root, where those $refs resolve. A
parameter scopes its definitions and references, because distinct types
reached by different parameters can have the same display name.
Source:<builtin>/ai/ns_internal/helpers.bamlbytes 659–1700