LangSchema.Converter.OpenAI (LangSchema v0.3.0)
View SourceSummary
Functions
Wraps the given JSON schema into the structure expected by OpenAI's Chat API when using response_format: "json_schema"
.
Functions
Wraps the given JSON schema into the structure expected by OpenAI's Chat API when using response_format: "json_schema"
.
This implementation follows the specification described under: OpenAI API Reference - Create Chat Completion (Request body → response_format → JSON schema → json_schema).
It sets the name
, attaches the provided JSON schema under the schema
field, and enforces strict: true
.
If a description
is provided in the options, it will be added as well.