Expand description
Ingot types to JSON Schema.
This is where the type system stops being decorative. ask<string[]> becomes
a schema the provider constrains its output to, and a response that does not
match is an error rather than a best-effort parse.
Two rules shape the mapping:
- Prose is not constrained.
textandmarkdownask for writing, so they get a plain completion. Constraining them to a JSON string would mean receiving markdown wrapped in JSON escaping — worse than not asking. - Non-object schemas are wrapped. Provider structured-output
implementations generally expect an object at the schema root, so a scalar
or array schema is nested under
valueand unwrapped on the way back.
Structs§
- Unsupported
Response Type - A response type that cannot be requested from a model.
Enums§
- Response
Shape - How a declared response type is requested from a provider.
Constants§
- FILE_
HANDLE_ FIELD - The runtime representation of a
file: a handle, never the content.
Functions§
- response_
shape - Work out how to request
ty, resolving record types againsttypes. - type_
schema - The JSON Schema for one Ingot type.
- validate
- Check a value against an Ingot type. Returns the first mismatch found.