Repository navigation
DashScope Python SDK v2.1.2: Smoother Streaming, Reliable TTS, and Cleaner Client Options #249
luk384090-cloud
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
DashScope Python SDK v2.1.2: Smoother Streaming, Reliable TTS, and Cleaner Client Options
v2.1.2 of the DashScope Python SDK is out. This is a quality-focused release: SSE streaming no longer hangs on open connections,
timeoutbehaves like a real client option, TTS final responses are preserved, and the wheel gets noticeably smaller. A big thanks to first-time community contributor @thzon for the streaming fix!🚀 Highlights
[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 @thzon in fix(sse): stop reading at the DONE marker #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 produce misleading errors such as fake 404s. Bare gateway error responses now yield clearer messages withx-request-idfor diagnostics. (fix(api): alias timeout to request_timeout and handle bare gateway er… #247)SpeechSynthesizerpreserves usage-only and non-sentence final messages, so token usage and final response details are reliably captured. (fix(tts): preserve final response for non-sentence and usage-only mes… #248)dashscope/examplesfiles has been removed from the wheel (813 KB now); examples remain available in the sdist. (chore(packaging): drop examples from the wheel, keep them in the sdist #245)✨ Features
gen_referencetooling. (Dev/v2.1.2-2 #246)🐛 Bug fixes
[DONE]marker in both sync and async streams; previously they skipped[DONE]but kept reading until EOF, which could block or raise a late transport error. Regression tests cover the public chat completions API with a mock body that raises on any read after the terminal event. (fix(sse): stop reading at the DONE marker #244)timeoutis now treated as an alias forrequest_timeout(with a warning when both are provided) and never forwarded as a model parameter. Empty-body gateway responses yield actionable errors, andx-request-idis exposed for easier diagnostics. (fix(api): alias timeout to request_timeout and handle bare gateway er… #247)SpeechSynthesisOutputcan initialize with aNonesentence, so usage-only and non-timestamp messages are kept as final response candidates; the last event correctly wins whenoutput=None. (fix(tts): preserve final response for non-sentence and usage-only mes… #248)mainand Pages jobs are serialized, preventing overlapping deployments from racing.♻️ Refactoring
SpeechSynthesisResponseconstruction with the same public behavior, covered by new payload-scenario unit tests. (fix(tts): preserve final response for non-sentence and usage-only mes… #248)🔧 Build & CI
dashscope/examplesfrom the wheel (126 files, ~1.2 MB);examples/stays in the sdist for source users. The bundling dated from when the acli runtime was vendored in-repo — since refactor(cli): migrate agent runtime to dashscope-agenticx #230 the agent runtime lives in the publisheddashscope-agenticxpackage. (chore(packaging): drop examples from the wheel, keep them in the sdist #245)None.
📦 Installation
Standalone CLI binaries and per-platform
SHA256SUMSare also attached to the release assets.👥 Contributors
Thanks to everyone who made this release possible: 🎉 @thzon (first contribution, #244!), @luk384090-cloud, @lzsweb
📝 Full changelog
See the complete diff: v2.1.1...v2.1.2
If streaming, timeouts, or TTS were causing you trouble, this release is worth the upgrade — and if anything still looks off, please report it here.
All reactions