Skip to content

schema must be present and not null when text.format.type is json_schema #534

@nascent-david

Description

@nascent-david

This is used to enable structured model outputs.

schema in async_openai::types::assistants::ResponseFormatJsonSchema is an Option (which is skipped if None), but this contradicts OpenAI's official type from the Python SDK, where it is not Optional.

OpenAI's API is accommodating and will fall back to disabling structured outputs if you do not provide a schema, but other implementations, like VLLM, are not, and will reject your request:

{
'type': 'missing', 'loc': ('body', 'text', 'format', 'ResponseFormatTextJSONSchemaConfig', 'schema'),
   'msg': 'Field required',
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions