From the parent issue...
- Request Fields: Accepted but IgnoredThis field is parsed into the model_options dict but the endpoint does not map it to Mellea concepts.
| Field |
What Should Happen |
| response_format |
json_object or json_schema should map to the format= parameter on instruct(). |
- Mellea-Specific Concepts That Need API Surface
e) Structured Output / Format
instruct() accepts format: type[BaseModel] for constrained decoding. OpenAI's
response_format only supports text or json_object, but newer versions add a
json_schema type with an inline JSON Schema.
Approach: Support the OpenAI response_format.type = "json_schema" field with
an inline schema. On the server side, dynamically construct a Pydantic model from
the JSON schema and pass it as format=.
From the parent issue...
e) Structured Output / Format
instruct() accepts format: type[BaseModel] for constrained decoding. OpenAI's
response_format only supports text or json_object, but newer versions add a
json_schema type with an inline JSON Schema.
Approach: Support the OpenAI response_format.type = "json_schema" field with
an inline schema. On the server side, dynamically construct a Pydantic model from
the JSON schema and pass it as format=.