fix(togetherai): enable structured outputs for DeepSeek V4 Flash (#19836)
## Background Together lists `deepseek-ai/DeepSeek-V4-Flash-0731` as supporting structured outputs in its [serverless model catalog](https://docs.together.ai/docs/serverless/models), and its [structured output guide](https://docs.together.ai/docs/inference/chat/structured-outputs) accepts JSON Schema through `response_format`. `@ai-sdk/togetherai` currently leaves `supportsStructuredOutputs` disabled. The OpenAI-compatible layer therefore rewrites `json_schema` requests to `json_object`, discarding the schema, name, description, and strict setting with an unsupported-format warning. ## Summary - Enable structured outputs for the exact documented DeepSeek V4 Flash model. - Keep unknown and unsupported Together models disabled. - Add regression coverage for both the capability decision and constructor wiring. - Update the generate and stream object examples to use DeepSeek V4 Flash with shape-explicit JSON prompts. - Add the model ID to typed suggestions and include a patch changeset. ## End-to-End Verification Manually exercised the patched Together provider request path for both generation and streaming with an enum-constrained schema. Both outgoing requests contained `response_format.type: json_schema`, the full schema, name, description, and `strict: true`, with no unsupported-format warning. An unknown model retained the existing `json_object` fallback and warning. A live native Together request was not run because this environment does not have a `TOGETHER_API_KEY`. ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)
G
Gaurav Arora committed
ebf0bd5144c9aefc6fbdc03d42493e056c7fd3c3
Parent: a6463ca
Committed by GitHub <noreply@github.com>
on 8/27/2026, 10:21:38 PM