response_format constrains the shape of the reply. warpllm forwards it and
returns what the provider produces.
JSON mode
The loosest form: valid JSON, shape unconstrained.JSON Schema
The strict form: the reply conforms to a schema you supply.The json_schema object
string
required
A name for the schema. Providers use it in their own error messages.
object
The JSON Schema itself.
boolean
Ask the provider to guarantee conformance rather than merely attempt it.
Providers that support it usually also constrain what the schema may contain
— commonly requiring
additionalProperties: false and listing every property
in required.string
Optional guidance for the model about what the schema is for.
Always parse defensively
content is a string. Even with strict: true, treat parsing as fallible:
- The model may hit
max_tokensmid-object. Checkfinish_reason— alengthfinish means the JSON is cut off. - A refusal populates
message.refusaland leavescontentnull. - Not every provider on the roster enforces
strictthe same way.
Provider support varies
response_format is forwarded, not emulated. A provider that does not
implement json_schema rejects the request rather than degrading to plain
text, and that rejection reaches you as a BadRequestError with the provider’s
own message.
Next
Tool calling
The portable route to a shaped answer.