Repository navigation
v2.1.2
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) timeoutis now a proper client option β it is aliased torequest_timeoutinstead 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 withx-request-idfor diagnostics. (#247)- TTS final responses are no longer lost β
SpeechSynthesizernow 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/examplesfiles 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_referencetooling, and the version badge is read fromdashscope/version.py.
β»οΈ Refactoring
- tts: simplify
SpeechSynthesisResponseconstruction (#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 existingfinallyblocks 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.
- Previously the shared sync and async SSE streams skipped
- api: alias
timeouttorequest_timeoutand handle bare gateway errors (#247)- The
timeoutkeyword is treated as an alias forrequest_timeoutin 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-idheader 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.
- The
- tts: preserve final response for non-sentence and usage-only messages (#248)
SpeechSynthesisOutputcan now initialize with aNonesentence, so usage-only and non-timestamp messages are kept as final response candidates instead of being dropped.- A final message with
output=Nonecorrectly 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
mainand 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 publisheddashscope-agenticxpackage and nothing consumes the installed copy. examples/stays in the sdist via the unchangedMANIFEST.infor source users; the stale-module cleanup inbuild_pyis preserved.
- The wheel no longer bundles
- 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:
- @thzon β π New contributor! First contribution in #244 (SSE
[DONE]marker fix) - @luk384090-cloud
- @lzsweb