qwen-plus
is good for most general use-cases with balanced performance and cost.qwen-max
offers the highest quality for complex reasoning tasks.qwen-turbo
provides faster inference for simpler tasks.
Authentication
Set yourDASHSCOPE_API_KEY
environment variable. You can get one from Alibaba Cloud here.
Base URL
Dashscope provides different base URLs depending on your region:- International users:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1
- China mainland users:
https://dashscope.aliyuncs.com/compatible-mode/v1
If you are located in mainland China, you may need to override
base_url
Example
UseDashScope
with your Agent
:
Thinking Process
DashScope models support enabling thinking processes for enhanced reasoning: View more examples here.
Params
Parameter | Type | Default | Description |
---|---|---|---|
id | str | "qwen-plus" | The id of the Dashscope Qwen model to use |
name | str | "Qwen" | The name of the model |
provider | str | "Dashscope" | The provider of the model |
api_key | Optional[str] | None | The Dashscope API key for authentication |
base_url | str | "https://dashscope-intl.aliyuncs.com/compatible-mode/v1" | The base URL for the Dashscope API |
enable_thinking | Optional[bool] | None | Enable thinking process for enhanced reasoning |
include_thoughts | Optional[bool] | None | Include thinking process in the response |
DashScope
also supports the params of OpenAI.