Skip to content

v2.1.2

Choose a tag to compare

@github-actions github-actions released this 27 Nov 08:09
· 10 commits to main since this release
c39ed04

v2.1.2 Release Notes

πŸš€ Highlights

  • SSE streams now stop at the [DONE] marker β€” sync and async iterators no longer read past the terminal event, eliminating hangs and late transport errors when the server keeps the connection open. Contributed by our first-time community contributor @thzon! (#244)
  • timeout is now a proper client option β€” it is aliased to request_timeout instead of being silently forwarded to the service as a model parameter (which could cause misleading errors such as fake 404s). Bare gateway error responses also produce clearer, actionable messages with x-request-id for diagnostics. (#247)
  • TTS final responses are no longer lost β€” SpeechSynthesizer now preserves usage-only and non-sentence final messages, so token usage and final response details are reliably captured. (#248)
  • Smaller wheel β€” the ~1.2 MB of bundled dashscope/examples files has been dropped from the wheel (813 KB now); examples remain available in the sdist. (#245)

✨ Features

  • docs: synchronize API reference and release notes rendering (#246)
    • The docs site now renders published GitHub Releases directly into the Release Notes pages (EN/ZH) at build time β€” GitHub Releases is the single source of truth, no manual table edits needed.
    • API reference pages are synchronized automatically via the reworked gen_reference tooling, and the version badge is read from dashscope/version.py.

♻️ Refactoring

  • tts: simplify SpeechSynthesisResponse construction (#248) β€” leaner response assembly with the same public behavior, covered by new payload-scenario unit tests.
  • gen_reference: restructure and improve reference page synchronization (#246) β€” more robust generation and diffing of API reference pages for the docs site.

πŸ› Bug Fixes

  • sse: stop reading at the [DONE] marker (#244)
    • Previously the shared sync and async SSE streams skipped [DONE] but kept reading the HTTP response until EOF. If the server left the connection open after the terminal event, consuming an otherwise completed stream could block waiting for more data or raise a later transport error.
    • Both iterators now terminate immediately at [DONE] and their existing finally blocks close the response. Sync and async regression tests exercise the public chat completions API with a mock body that raises on any read after the terminal event.
  • api: alias timeout to request_timeout and handle bare gateway errors (#247)
    • The timeout keyword is treated as an alias for request_timeout in the client, with a warning when both are provided; it is never forwarded as a model parameter.
    • Bare gateway responses (empty body, no content-type) now yield improved error messages instead of opaque failures, and the x-request-id header is extracted and exposed in error responses for easier diagnostics.
    • Regression tests cover timeout aliasing and bare gateway error handling in both sync and async paths, plus end-to-end tests verifying timeout enforcement and diagnostic error surfacing.
  • tts: preserve final response for non-sentence and usage-only messages (#248)
    • SpeechSynthesisOutput can now initialize with a None sentence, so usage-only and non-timestamp messages are kept as final response candidates instead of being dropped.
    • A final message with output=None correctly overwrites earlier extra messages, ensuring the last event wins.
    • New unit tests verify capturing of usage and final response details across a range of response payload scenarios.
  • docs: dispatch release deployments on main and serialize Pages jobs (#246) β€” prevents overlapping GitHub Pages deployments from racing each other.
  • docs: add missing comma in release notes table formatting (#246).

πŸ“š Documentation

None

πŸ”§ CI & Chore

  • packaging: drop examples from the wheel, keep them in the sdist (#245)
    • The wheel no longer bundles dashscope/examples (~1.2 MB / 126 files). The bundling dated from when the acli runtime was vendored in-repo; since #230 the agent runtime lives in the published dashscope-agenticx package and nothing consumes the installed copy.
    • examples/ stays in the sdist via the unchanged MANIFEST.in for source users; the stale-module cleanup in build_py is preserved.
  • docs: add automated docs build and release notes integration (#246) β€” publishing a GitHub Release now triggers the Docs workflow to rebuild and deploy GitHub Pages automatically.
  • legacy: preserve sync non-JSON body content in response handling (test coverage) (#247).
  • cli: add test to verify silence on dumb terminal (#246).
  • tests: satisfy pre-commit trailing comma formatting (#246).

⚠️ Breaking Changes

None


πŸ“¦ Installation

pip install --upgrade dashscope==2.1.2

πŸ‘₯ Contributors

Thanks to all the contributors who made this release possible:

πŸ“ Full Changelog

v2.1.1...v2.1.2