-
177d8f1: Improve Qwen 3.5 compatibility and reorganize the provider internals without changing the main public API.
This release also removes noisy stream debug logging and keeps the local rerank script aligned with the refactored source layout.
- dcc41cf: Fix reasoning content parts in assistant messages breaking multi-turn conversations (fixes #8)
- Silently ignore
reasoningandfileparts in assistant messages instead of throwingUnsupportedFunctionalityError - Models like GLM-4.7 return reasoning parts that were causing dialogue interruption when passed back in subsequent API calls
- Silently ignore
- 1bc9fbc: Stabilize streaming tool-calls and reasoning
- Add retry logic for Qwen streaming API transient 500 errors (
list index out of range) - Support
reasoningfield alongsidereasoning_contentfor compatibility - Fix incomplete tool-call assembly during streaming by buffering and reassembling fragmented chunks
- Improve in-stream error detection and recovery for known Qwen boundary failures
- Add retry logic for Qwen streaming API transient 500 errors (
- Reranking API Improvements - Support both
qwen3-rerankandgte-rerankmodelsqwen3-rerank: Uses OpenAI-compatible API (/compatible-api/v1/reranks)gte-rerank-v2: Uses DashScope native API (/api/v1/services/rerank/...)- Add
instructsetting for task-specific ranking (qwen3-rerank only) - Update model capabilities documentation
- Fix endpoint for qwen3-rerank from
/compatible-mode/v1/rerankto/compatible-api/v1/reranks
- Fix reranking API endpoint and request format
- Use DashScope native API endpoint
/api/v1/services/rerank/text-rerank/text-rerankinstead of OpenAI compatible mode - Update request body format to
{ model, input: { query, documents }, parameters: { top_n } } - Update response parsing for
{ output: { results: [...] }, request_id }format - Add documentation for Chinese users using domestic endpoint
- Use DashScope native API endpoint
- 7f8dcd2: ### Improvements
- CI/CD: Configure automated npm publishing via GitHub Actions
- Add Changesets-based release workflow for automatic versioning
- Trigger releases automatically when changes are merged to main
- Simplify pre-release workflow for dry-run testing
- Reranking Model: Add support for Qwen reranking models
- New
QwenRerankingModelfor document reranking tasks - Support for
gte-rerankmodel family
- New
- CI/CD: Configure automated npm publishing via GitHub Actions
- 🚀 AI SDK v6 Support - Upgrade to Vercel AI SDK v6 (specification v3)
- Updated to
@ai-sdk/provider@^3.0.0(was ^2.0.0) - Updated to
@ai-sdk/provider-utils@^4.0.0(was ^3.0.0) - Migrated
QwenChatLanguageModeltoLanguageModelV3interface - Migrated
QwenCompletionLanguageModeltoLanguageModelV3interface - Migrated
QwenEmbeddingModeltoEmbeddingModelV3interface
- Updated to
- Minimum AI SDK Version: Now requires AI SDK v6 (
ai@^6.0.0) - FinishReason Format: Changed from string to object
{ unified: string, raw: string | undefined } - Usage Format: Changed to nested structure with
inputTokens: { total, noCache, cacheRead, cacheWrite }andoutputTokens: { total, text, reasoning } - Warnings Format: Changed from
type: "unsupported-setting"totype: "unsupported"withfeatureproperty
If you are using AI SDK v5, please continue using qwen-ai-provider-v5@^1.0.0.
-
Tool Call Compatibility:
- Fixed
QwenChatLanguageModelto emittool-callstream parts with stringinputpayloads, matching the AI SDK v5LanguageModelV2ToolCallcontract - Ensured non-streaming
doGeneratealso returnstool-callcontent with stringified JSONinput - This resolves
toolCall.input.trim is not a functionerrors when usingqwen-ai-provider-v5together with ai-sdk v5 tool execution
- Fixed
-
Testing:
- Updated chat model tests to assert string
inputfor tool calls in both streaming and non-streaming modes
- Updated chat model tests to assert string
-
Package Metadata: Updated package information for npm publication
- Changed package name to
qwen-ai-provider-v5 - Updated repository URL to https://github.com/bolechen/qwen-ai-provider
- Updated author information
- Changed package name to
-
Documentation: Enhanced README with AI SDK v5 focus
- Added prominent notice about AI SDK v5 requirement
- Linked to original
qwen-ai-providerpackage for v4 users - Updated all code examples to use
qwen-ai-provider-v5imports - Added acknowledgment to original author
-
🎉 AI SDK v5 Migration - Complete migration to Vercel AI SDK v5 (specification v2)
- Migrated
QwenChatLanguageModeltoLanguageModelV2interface - Migrated
QwenCompletionLanguageModeltoLanguageModelV2interface - Migrated
QwenEmbeddingModeltoEmbeddingModelV2interface - Updated
QwenProviderinterface to v2 specifications
- Migrated
-
Breaking Changes:
- Updated to
@ai-sdk/provider@^2.0.0(was ^1.0.7) - Updated to
@ai-sdk/provider-utils@^3.0.0(was ^2.1.6) - Changed response format from
{text, toolCalls}to{content: []}array - Usage fields now use
inputTokens/outputTokensinstead ofpromptTokens/completionTokens - Parameters changed:
maxOutputTokensinstead ofmaxTokens,providerOptionsinstead ofproviderMetadata - Removed
modeparameter; tools and toolChoice are now direct parameters - Stream parts updated to V2 format with
text-start/text-delta/text-endpattern
- Updated to
-
Enhanced Tool Handling:
- Improved tool call error handling and validation
- Better tool response conversion in chat messages
- Enhanced tool streaming support with proper delta handling
-
Improved Error Handling:
- Better error messages for QwenChat and QwenCompletion models
- Refined system message content part conversion
- Improved handling of unsupported content types
-
Testing:
- Reorganized test files into
__tests__directory - Migrated all 95+ tests to V2 API format
- Implemented custom fetch mocking pattern to avoid DataCloneError
- Added MSW (Mock Service Worker) dependency for testing
- Complete test coverage maintained: chat model (44 tests), completion model (22 tests), embedding model (6 tests)
- Reorganized test files into
-
Zod Compatibility:
- Added support for Zod v4 alongside v3
- Peer dependency:
zod@^3.25.76 || ^4.1.8 - Updated Zod response schemas
-
Code Quality:
- Added semicolons to all TypeScript files for consistency
- Tightened peer dependency ranges
- Added prepack script to ensure built artifacts
-
Build:
- Verified TypeScript compilation with strict mode
- Dual format output: CommonJS and ESM
- Source maps and type declarations included
The following versions are from the original qwen-ai-provider package for AI SDK v4:
- 06feb5c: - Fixed the onFinish hook token usage response
- Updated the zod response scheme
- Handle unsupported content parts in assistant messages
-
This release introduces several improvements and new features across the project:
- Added support for chat, completion, and text embedding models with the introduction of
QwenChatLanguageModel,QwenCompletionLanguageModel, andQwenEmbeddingModel. - Enabled the provider to construct and configure these models dynamically based on request parameters.
- Integrated provider utilities to manage API key loading.
- For testing, the
DASHSCOPE_API_KEYenvironment variable is mocked to ensure tests run reliably without exposing real credentials. - Introduced a JSON error response handler (
createJsonErrorResponseHandler) to streamline error processing. - Improved error messaging and handling in the provider modules, including detailed error responses consistent with API validation.
- Expanded test coverage for all model classes to cover various configurations and edge cases.
- Applied comprehensive mocking of relevant modules (including provider utilities and language model classes) to ensure tests run in isolation.
- Added the ability to override environment variables in tests using
vi.stubEnv. - Updated GitHub Actions workflows for continuous integration and publishing.
- Configured a dedicated GitHub workflow for releases using changesets.
- Enhanced npm publishing automation with proper authentication setup (using
NPM_TOKEN). - Fixed issues where missing or misconfigured API keys were causing test failures.
- Resolved errors related to unauthorized npm publishing by enforcing proper npm authentication.
- Addressed several configuration inconsistencies in the test harness that led to unexpected behavior across language model tests.
- Updated changelogs automatically via changesets.
- The release is fully documented with comprehensive commit logs and automated changelog generation to track updates in functionality and configuration.
Enjoy the new features and improvements! 🎉
- Added support for chat, completion, and text embedding models with the introduction of
- Initial release of qwen-ai-provider:
- Added QwenChatLanguageModel for chat completions
- Added QwenCompletionLanguageModel for text completions
- Added QwenEmbeddingModel for text embeddings
- Added provider utilities and error handling
- Added comprehensive test coverage
- Added GitHub Actions workflows for CI/CD
- Added npm package configuration