npm / @ai-sdk/alibaba
@ai-sdk/alibaba
What changed in @ai-sdk/alibaba 0.0 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
60 breaking20 deprecations20 new APIs and options2 performance12 behavior and defaults1 tooling15 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/alibaba 762 changes
Breaking changes 38
OpenTelemetry span collection is no longer built into ai; install this package and register an OpenTelemetry instance globally to continue receiving traces.
The deprecated top-level LanguageModelUsage field was removed; use inputTokenDetails.cacheReadTokens instead.
All packages are ESM-only; consumers using require() must switch to ESM import syntax.
Top-level result properties including content, tool calls and results, files, sources, and warnings now accumulate values across every step; use finalStep for final-step values.
Tool callbacks now use stable, tool-specific context inferred from contextSchema and supplied through toolsContext, replacing experimental_context.
The deprecated option has been removed; replace usages with activeTools.
The deprecated export was removed; use customProvider instead. Its options and behavior are unchanged.
The deprecated export was removed; use generateImage instead.
The deprecated result type export was removed; use GenerateImageResult instead.
Rename the generation start callback for generateText, streamText, and agents to onStart.
Rename the per-step start callback for generateText, streamText, and agents to onStepStart.
The deprecated structured-output call option was removed; use output instead.
The deprecated generateText result property was removed; read result.output instead.
The deprecated option was removed; use prepareStep instead.
The tracer property was removed from experimental_telemetry; pass a custom OpenTelemetry Tracer to the OpenTelemetry constructor instead.
generateText and streamText no longer include request bodies in step results by default; opt in with include.requestBody when your application reads them.
generateText no longer includes response bodies by default; opt in with include.responseBody when your application reads them.
The deprecated function has been removed; use isToolUIPart instead.
The redirect option now defaults to error rather than follow, rejecting HTTP redirects by default to prevent SSRF; explicitly set follow if the MCP server relies on redirects.
The deprecated tool-result content part type has been removed; use the file content part for inline tool-result files.
The minimum supported Node.js version is 22; supported versions are 22, 24, and 26.
streamText now calls onChunk for every TextStreamPart, including lifecycle, boundary, and terminal parts; handlers should guard the chunk types they process.
Telemetry integrations and tracing-channel subscribers receive onEmbedEnd instead of onEmbedFinish.
The per-call callback for completed embed and embedMany operations is named onEnd instead of experimental_onFinish.
The per-call callback for completed rerank operations is named onEnd instead of experimental_onFinish.
The callback event follows the updated multi-step result shape: usage and several result properties cover all steps, while final-step-only properties are available on finalStep.
Telemetry integrations and tracing-channel subscribers receive onRerankEnd instead of onRerankFinish.
The per-step lifecycle callback is named onStepEnd across text and object generation, agents, workflow agents, and UI message stream helpers; telemetry integrations should implement it.
Instructions returned from prepareStep now carry forward to future steps until another instructions or system override is returned.
Messages returned from prepareStep now become the base for subsequent steps, combined with response messages from the previous step.
System messages in prompt or messages are rejected by default; move system instructions to instructions or opt in with allowSystemInMessages for trusted messages.
The deprecated top-level LanguageModelUsage field was removed; use outputTokenDetails.reasoningTokens instead.
Shared generation or agent runtime data is now separate from tool-specific context; use runtimeContext for shared state visible in prepareStep, events, and step results.
Each StepResult now contains only response messages produced by that step; use result.responseMessages for the full response message history.
Rename the tool-loop stop-condition helper to isStepCount.
The deprecated type has been removed; replace imports and type references with ToolExecutionOptions.
Pass tool-specific context through toolsContext keyed by tool name; when a tool declares contextSchema, toolsContext becomes required and includes only tools declaring contextual data.
generateText and streamText usage now totals tokens across all steps; use finalStep.usage for final-step-only usage, and replace deprecated totalUsage with usage.
Deprecations 13
CallSettings is split into LanguageModelCallOptions and RequestOptions; replace usages with LanguageModelCallOptions & Omit<RequestOptions, 'timeout'>. The deprecated type remains available.
The result type is renamed to SpeechResult; the old name remains available as a deprecated alias.
The result type is renamed to TranscriptionResult; the old name remains available as a deprecated alias.
Tool-result file content now has a canonical file variant with tagged data and a required mediaType; legacy image-* and file-* variants are runtime-migrated but deprecated.
Final-step reasoning, request, response, and provider metadata are accessed through finalStep; the top-level aliases are deprecated and remain available for incremental migration.
The user-message image content part is deprecated; use a file part with an image mediaType instead.
The tool() and dynamicTool() property is deprecated; move approval logic to toolApproval on the call or agent so approval policy can vary by request.
The final lifecycle callback for generateText, streamText, and agents is named onEnd; onFinish remains a deprecated alias, and onEnd takes precedence when both are provided.
This generateText and streamText callback replaces experimental_onToolCallFinish; the old name remains a deprecated fallback.
This generateText and streamText callback replaces experimental_onToolCallStart; the old name remains a deprecated fallback.
The full event stream returned by streamText is now exposed as stream; fullStream remains a deprecated alias.
Use instructions for top-level prompts, prepareStep results, repair-tool-call options, and lifecycle callback fields. system remains a deprecated fallback, and instructions takes precedence when both are provided.
The streamText result method is deprecated; use the stateless top-level helper to transform any stream.
New APIs and options 5
Declare each tool's contextual fields with contextSchema so tool callback context is typed and limited to the fields that tool declares.
Move streamText's raw-chunk option from the top-level includeRawChunks option into include.rawChunks; the old option remains a deprecated alias.
Models can return files in reasoning under a distinct reasoning-file type; update exhaustive part handling to support it.
The top-level option is the provider-agnostic way to control reasoning effort; overlapping providerOptions settings take precedence and can bypass it.
Use toolApproval on a call or agent to configure per-tool approval, including a callback in place of needsApproval logic.
Behavior and default changes 5
The speech generation function graduated from experimental status under the stable name generateSpeech; the old name remains as a deprecated alias.
The stable include option replaces experimental_include for generateText, streamText, and ToolLoopAgent; the old name remains a deprecated alias.
After a telemetry integration is registered, AI SDK calls emit telemetry events by default; set isEnabled to false on a call to opt out.
The telemetry option replaces experimental_telemetry; the old name remains a deprecated alias during the migration window.
The transcription API graduated from experimental status under the stable name transcribe; the old name remains as a deprecated alias.
Tooling 1
Adds the migration skill to guide an agent through migrating from AI SDK v6 to v7.
@ai-sdk/alibaba 629 changes
Breaking changes 15
The Azure provider now uses the Responses API by default; use azure.chat() to retain Chat Completions API behavior.
For the Responses API, providerOptions uses azure instead of openai, and providerMetadata output uses azure.
Now asynchronous to support async Tool.toModelOutput(); callers must await it.
The deprecated CoreMessage type and related functions have been removed; use ModelMessage and convertToModelMessages.
Provider textEmbeddingModel methods are renamed to embeddingModel; generics are also removed from EmbeddingModel, embed, and embedMany.
Replaces getToolName for retrieving the name from static tool parts only.
Replaces isToolUIPart for checking static tool UI parts.
V2 mock classes have been removed from ai/test; use the V3 mock classes instead.
Function tool definitions no longer accept a name property; function tool names come from keys in the tools object.
OpenAI JSON outputs and tool calls now use strict schema mode by default; schemas may need adjustment or strict mode can be disabled.
Removed from OpenAI chat models; use strictJsonSchema instead.
Receives a parameter object containing an output property instead of receiving output directly.
Replaces Experimental_Agent; the system parameter is now instructions, and stopWhen defaults to isStepCount(20).
The unknown finish reason is removed and is now returned as other.
Separate generation-function warning types are consolidated into a single type exported from the ai package.
Deprecations 7
Deprecated in LanguageModelUsage; replace it with inputTokenDetails.cacheReadTokens.
Deprecated in favor of generateText with an output setting for generating structured data.
Now retrieves a tool name from static or dynamic tool parts; the former getToolOrDynamicToolName name is deprecated but remains available.
Now checks for static or dynamic tool UI parts; the former isToolOrDynamicToolUIPart name is deprecated but remains available.
Deprecated in LanguageModelUsage; replace it with outputTokenDetails.reasoningTokens.
Deprecated in favor of streamText with an output setting for streaming structured data.
Renamed to ToolExecutionOptions; the old type is now deprecated.
New APIs and options 5
Set this environment variable to false to disable warning logging for deprecation warnings and best-practice recommendations.
Tool strict mode is now set on each tool, enabling fine-grained control based on each tool's input schema.
Anthropic structured outputs can use outputFormat, jsonTool, or auto, which selects native output format when supported and otherwise falls back to jsonTool.
The state union adds approval-requested, approval-responded, and output-denied states; exhaustive state handling should cover them.
The system parameter now accepts SystemModelMessage as well as string, allowing provider-specific options such as caching.
Behavior and default changes 2
Tool output and result content support is more flexible, enabling richer tool interactions and complex tool execution patterns.
The Google Vertex provider now uses vertex instead of google for providerOptions and providerMetadata; google remains supported for providerOptions input.
@ai-sdk/alibaba 230 changes
Breaking changes 5
The experimental OpenAI Live method can now resolve asynchronously; await its result before using the connection settings.
Top-level reasoning values map to the closest supported model level, rounding down when possible; unsupported none values map to the model's minimum level with a compatibility warning.
Reasoning is now placed before text in doGenerate.
Reasoning is preserved in multi-turn requests by default on supported models.
File part data is now tagged with a type, and the image part type is removed.
New APIs and options 9
Adds max as a portable reasoning level, widening LanguageModelV4CallOptions['reasoning'] and the derived ReasoningLevel type.
Adds support for wan3 all-in-one video generation.
Adds embedding model support for Alibaba.
File uploads are supported according to provider capabilities.
Adds a first-class generateAudio call option.
The provider adds support for provider references.
Adds the qwen3.7-max model ID to Alibaba and AI Gateway.
Providers now support a new top-level reasoning parameter.
Provider model classes can cross workflow step boundaries without serialization errors through WORKFLOW_SERIALIZE and WORKFLOW_DESERIALIZE static methods.
Performance 1
Provider validation schemas are constructed on first use instead of at import time, reducing package import time.
Behavior and default changes 5
Autocomplete suggestions are derived from each provider’s model catalog declarations, so catalog updates are reflected while existing suggestions, endpoint-specific lists, and custom model IDs remain supported.
These settings now support promises and synchronous or asynchronous callbacks, resolving credentials per authenticated request while preserving existing authentication behavior and synchronous credential serialization.
Wan video requests use the Wan 2.7 wire format for later Wan 2 minors; future majors and unknown IDs use the current all-in-one media protocol instead of legacy size and reference fields.
Top-level embedding dimensions are mapped to provider settings.
headers is optional in provider config types, allowing manually constructed model configs to omit it when auth is provided separately.
Fixes and other changes 10
Alibaba streams that end cleanly without a provider completion signal now report the interrupted finish reason, preserving partial output without emitting an error solely for the interruption.
Provider-returned identifiers are encoded in credentialed follow-up request paths.
The User-Agent header is now standards-compliant.
Fixes streamed tool calls with missing, blank, or repeated IDs.
Uses model-specific structured output modes.
Prevents negative text output token counts when providers report reasoning tokens; Perplexity reasoning tokens are treated separately from completion tokens.
Handle empty string tool call IDs.
Fixes cache control handling for a single-item content array.
Tool calls now finalize only after the stream is fully consumed, preventing execution with incomplete arguments when partial JSON happens to be parsable.
Alibaba's doGenerate path now uses generateId() as a fallback when toolCallId is missing.
@ai-sdk/alibaba 16 changes
Breaking changes 1
Reasoning is preserved by default in multi-turn requests on supported models.
New APIs and options 1
Introduces the Alibaba provider for use in applications.
Performance 1
Validation schema construction is deferred until first use to reduce provider import time.
Fixes and other changes 3
Provider-returned identifiers are encoded in follow-up request paths.
In doGenerate, reasoning is now placed before text.
Reasoning streams are preserved across empty tool-call deltas for DeepSeek.
@ai-sdk/alibaba 0.03 changes
Breaking changes 1
Reasoning is preserved by default in multi-turn requests on supported models.
Fixes and other changes 2
Tool calls are now finalized when the stream ends, preventing valid partial JSON from causing truncated arguments to run.
Reasoning streams are preserved across empty tool-call deltas.