@ai-sdk/provider
4.0.39 · 17 Nov 2026Apache-2.0107.4M / weekRepositoryHomepagenpmAtom feed
Upgrading @ai-sdk/provider From 4.0.5 to 4.0.39
34 releases in betweenevery note read
Reading releases, release notes and advisories…
Release by release
- New
Add extraction model support to provider registries, custom providers and string model ids
- New
- New
Add experimental extract api and extraction model spec
- Fixed
Prevent excessive memory and CPU usage when validating malformed UI messages.
validateUIMessages,safeValidateUIMessages, and the agent UI stream helpers reported the issues of every part schema for every invalid part, so a small request with many malformed parts could exhaust memory. Each part is now validated against the schemas for its type only, validation stops at the first invalid message or part, and an invalid JSON value in provider or tool metadata is reported as a single issue. - Fixed
Forward the provider's configured fetch transport when downloading file inputs. Add a
fetchoption tocreateDownloadso core downloads can also useguarded-fetchfor opt-in DNS validation on Node.js. The function returned bycreateDownloadcan now also be passed asexperimental_downloadtogenerateTextandstreamText, andexperimental_downloadnow also handles generated file URLs returned by the model, so one hook covers all core downloads. Document that the default URL checks do not resolve DNS and recommend the guarded transport or network egress controls for untrusted URLs. - Fixed
Warn when a UI message stream sends a tool error text that differs from the text the model received and then sends reasoning from a later step. By default,
toUIMessageStreamsends "An error occurred." to the client for a failed tool call, while the model receives the full error text during a multi-step call. Converting the stored UI messages back withconvertToModelMessagesthen changes the tool result, and models that bind reasoning to the preceding messages (for example Anthropic models with preserved thinking) reject the request. The request still fails after this change; the warning and the updated documentation explain the cause and the available options. - Fixed
Send the error text of failed tool calls to the client as the model received it.
- New
- Fixed
Fix TypeSafe decision requests with primitive JSON state by serializing those values as text, reject empty criteria and null or undefined Score levels before sending a request, and expose structured Score legends in provider metadata. Allow omitted or null Box instructions and null Boolean criteria in experimental decision question types.
- Fixed
- New
Support native URL transcription with an optional provider capability, keeping existing file-generation contracts unchanged. Groq sends HTTP(S) audio URLs through its
urlparameter without downloading and re-uploading them, avoiding the attachment upload limit. Supplying a customdownloadfunction retains local download behavior. - New
ai: Support provider-owned realtime transports
- New
Expose optional transcription word timings separately from segments and accept shared timestampGranularities. Explicit provider timing settings take precedence. OpenAI now sends timestamp_granularities only with verbose_json and warns when a requested timing is unavailable or excluded.
- New
Add typed streaming heartbeat parts. Anthropic emits them only with
includePings: true(disabled by default), without requiring raw chunks. Core forwards pings through stream retries without storing them as generated content or sending them to UI message streams. Consumers with exhaustive stream-part switches must handle the newpingunion variant when upgrading, even when the opt-in is disabled. Typed pings do not flush partial words during stream smoothing.
- New
- New
Introduce a model entry contract with named capability sections and request configuration. Consolidate the OpenAI and Anthropic model catalogs so existing request behavior and generated capability documentation use the same source of truth. Catalogs also declare the provider options each provider accepts and which models support them.
- New
- Fixed
Fix non-streaming Responses API structured output failing when multiple assistant messages contain JSON. Providers can supply separate structured-output text for parsing, allowing OpenAI and Azure Responses models to select the last
final_answerwhile preserving all generated content, annotations, conversation history, and token usage.
- Fixed
- New
provider: Add experimental streaming speech model spec
- New
- New
Add the
interruptedfinish reason for provider streams that end without a completion signal. Preserve partial output without introducing an error solely for interruption, and stop tool execution, agent continuation, and automatic UI follow-ups for interrupted responses, including late tool results and approvals. Provider detection and emission will be added separately.
- New
3 internal lines (docs, tests, tooling) left out.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.