Leverage DashScope’s powerful command models and more. DashScope supports a wide range of models We recommend experimenting to find the best-suited model for your use-case. Here are some general recommendations:
  • qwen-plus model is good for most use-cases.

Authentication

Set your DASHSCOPE_API_KEY environment variable. Get your key from here.
export DASHSCOPE_API_KEY=***

Example

Use DashScope with your Agent:
from agno.agent import Agent
from agno.models.dashscope import DashScope

agent = Agent(
    model=DashScope(id="qwen-plus"),
    markdown=True
)

# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story.")

View more examples here.

Params

ParameterTypeDefaultDescription
idstr"qwen-plus"The specific model ID used for generating responses.
namestr"Qwen"The name identifier for the DashScope agent.
providerstr"Dashscope"The provider of the model.
api_keyOptional[str]-The API key for authenticating requests to the DashScope service. Retrieved from the environment variable DASHSCOPE_API_KEY or QWEN_API_KEY.
base_urlstr"https://dashscope-intl.aliyuncs.com/compatible-mode/v1"The base URL for making API requests to the DashScope service.
DashScope also supports the parameters of OpenAI.