DashScope integration for Pipecat
Project description
pipecat-dashscope
pipecat-dashscope provides native DashScope service integrations for Pipecat.
This package uses DashScope native SDK integrations and does not rely on OpenAI-compatible endpoints.
Why Native DashScope APIs
- Pipecat pipelines are latency-sensitive and depend on realtime streaming/event semantics.
- Chat Completions and Responses APIs are typically not sufficient for low-latency turn handling in voice agents.
- Native DashScope SDK integrations keep behavior aligned with DashScope protocol families (
Generation,MultiModalConversation,tts_v2, andqwen_tts_realtime). - Use
examples/realtime_api_check.pyto verify that your endpoint supports the Realtime API before running voice pipelines.
Features
- Native DashScope
GenerationLLM integration (DashScopeGenerationLLMService) - Native DashScope
MultiModalConversationLLM integration (DashScopeMultiModalLLMService) - Native DashScope ASR integration for segmented STT
- Native DashScope
tts_v2TTS integration - Native DashScope
qwen_tts_realtimeintegration - Native DashScope
MultiModalConversationTTS integration - Runtime-updatable Pipecat service settings
- Compatible with Pipecat
LLMContextand pipeline processors - Environment-variable based configuration for DashScope credentials
Installation
uv add pipecat-dashscope
Usage
The recommended usage is the end-to-end voice bot in examples/bot.py, which wires this pipeline:
transport.input() -> DashScopeSTTService -> user_aggregator -> DashScope LLM -> DashScope TTS -> transport.output() -> assistant_aggregator
Set your API key and run a preset:
export DASHSCOPE_API_KEY="your_api_key"
uv run --dev examples/bot.py --preset default
Available presets in examples/bot.py:
default: STTfun-asr-flash-8k-realtime, LLMgeneration/qwen3-max, TTSv2/cosyvoice-v3-flash, voicelonganyangfast: STTfun-asr-flash-8k-realtime, LLMgeneration/qwen-plus, TTSv2/cosyvoice-v2, voicelongxiaochun_v2quality: STTfun-asr-flash-8k-realtime, LLMgeneration/qwen3-max, TTSmultimodal/qwen-tts, voiceCherryrealtime: STTfun-asr-flash-8k-realtime, LLMmultimodal/qwen3.6-flash-2026-04-16, TTSqwen-realtime/qwen-tts-realtime, voiceCherry
Override any preset setting with CLI options:
uv run --dev examples/bot.py \
--preset realtime \
--llm-service multimodal \
--llm-model qwen3.6-flash-2026-04-16 \
--tts-service qwen-realtime \
--tts-model qwen-tts-realtime \
--tts-voice Cherry
Supported override flags:
--stt-model--llm-model--llm-service(generation,multimodal)--tts-service(v2,qwen-realtime,multimodal)--tts-model--tts-voice
Configuration
DASHSCOPE_API_KEY: required ifapi_key=is not passed for any serviceDASHSCOPE_BASE_URL: optional override for bothDashScopeGenerationLLMServiceandDashScopeMultiModalLLMService
Default LLM API base URL:
https://dashscope.aliyuncs.com/api/v1
Notes:
DashScopeGenerationLLMServiceuses DashScope native asyncAioGeneration.DashScopeMultiModalLLMServiceuses DashScope native asyncAioMultiModalConversation.DashScopeSTTServiceis a segmented STT service and expects VAD in the Pipecat pipeline.DashScopeTTSV2Serviceusesdashscope.audio.tts_v2.SpeechSynthesizer.DashScopeQwenRealtimeTTSServiceusesdashscope.audio.qwen_tts_realtime.DashScopeMultiModalTTSServiceusesdashscope.MultiModalConversationwith TTS-capable Qwen models.- All DashScope TTS services require explicit
modelandvoicevalues (no built-in runtime defaults). - Keep these three TTS API families separate when extending the package; do not merge them into a single service unless DashScope unifies the underlying protocol.
Example: examples/bot.py
examples/bot.py is an end-to-end Pipecat voice-agent demo that wires:
DashScopeSTTService(speech to text)DashScopeGenerationLLMServiceorDashScopeMultiModalLLMServiceDashScopeTTSV2Service,DashScopeQwenRealtimeTTSService, orDashScopeMultiModalTTSService
The script provides preset pipeline profiles (default, fast, quality, realtime) and supports overriding STT/LLM/TTS model, service family, and voice via CLI options.
Run it from this package directory:
uv run --dev examples/bot.py --preset quality
The example always uses SmallWebRTC transport and forwards other Pipecat runner options as needed.
Requirements:
- Set
DASHSCOPE_API_KEYin your environment. - Ensure
pipecat-airunner extras are installed (the packagedevdependency group includes them).
Testing
- Prefer unit tests around request shaping, settings translation, and audio payload decoding.
- Avoid live DashScope network tests in the default test path.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pipecat_dashscope-0.2.0.tar.gz.
File metadata
- Download URL: pipecat_dashscope-0.2.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
273a95eeff51a14794c0f2020ecb3aba17a4701687eb258e6e675dc375b0aabf
|
|
| MD5 |
ad72200620120b11b97fea617d47b7c1
|
|
| BLAKE2b-256 |
3bf6f4c0d3a90ee5526e0568f20cbe6517733029995bc75bf9fcac2276752015
|
Provenance
The following attestation bundles were made for pipecat_dashscope-0.2.0.tar.gz:
Publisher:
release-please.yml on AbaoFromCUG/pipecat-dashscope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pipecat_dashscope-0.2.0.tar.gz -
Subject digest:
273a95eeff51a14794c0f2020ecb3aba17a4701687eb258e6e675dc375b0aabf - Sigstore transparency entry: 1352586847
- Sigstore integration time:
-
Permalink:
AbaoFromCUG/pipecat-dashscope@e2ee9f8f66ed9ac90ba7f763ef3c10b8b5a586f5 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/AbaoFromCUG
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@e2ee9f8f66ed9ac90ba7f763ef3c10b8b5a586f5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pipecat_dashscope-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pipecat_dashscope-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e990b9193d2a725cd646c65e06734a2ae0bb2944755f88dea26bec781aa2bc5
|
|
| MD5 |
0585f554c3c430e0ad4c66971d97b8dc
|
|
| BLAKE2b-256 |
e24d50d0f0476218078161e52d980eaa4f91f72f43a07d565ad469c9220536da
|
Provenance
The following attestation bundles were made for pipecat_dashscope-0.2.0-py3-none-any.whl:
Publisher:
release-please.yml on AbaoFromCUG/pipecat-dashscope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pipecat_dashscope-0.2.0-py3-none-any.whl -
Subject digest:
6e990b9193d2a725cd646c65e06734a2ae0bb2944755f88dea26bec781aa2bc5 - Sigstore transparency entry: 1352586921
- Sigstore integration time:
-
Permalink:
AbaoFromCUG/pipecat-dashscope@e2ee9f8f66ed9ac90ba7f763ef3c10b8b5a586f5 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/AbaoFromCUG
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@e2ee9f8f66ed9ac90ba7f763ef3c10b8b5a586f5 -
Trigger Event:
push
-
Statement type: