Add structured outputs documentation for LLM Gateway #580
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds documentation for the structured outputs feature in LLM Gateway, which allows constraining model responses to follow a specific JSON schema using the
response_formatparameter.Documentation page (
fern/pages/07-llm-gateway/structured-outputs.mdx):response_formatandjson_schemaparametersOpenAPI spec updates (
llm-gateway.yml):response_formatparameter toLLMGatewayRequestschemaResponseFormatandJsonSchemaConfigschema definitionsUpdates since last revision
response_formatparameter to the LLM Gateway OpenAPI specification so it now appears in the API referenceResponseFormat(withtypeandjson_schemaproperties) andJsonSchemaConfig(withname,schema, andstrictproperties)Review & Testing Checklist for Human
ResponseFormatandJsonSchemaConfigschemas match the actual API implementation (especially theenum: [json_schema]for type - are there other valid values?)response_formatappears correctly in the API reference at/docs/api-reference/llm-gateway/create-chat-completionhidden: true(matches other LLM Gateway pages, but verify this is intentional)Recommended test plan:
response_formatparameter appears in the API reference with correct schema detailsNotes
CI failures are pre-existing issues in
transcripts.yml(unrelated to this PR). The[docs]validation passed.Requested by Dan Ince via Slack #ask-api-docs
Link to Devin run: https://app.devin.ai/sessions/4424438ef4014e0e886900b5303e6a6b