English | 简体中文
The large audio models from Tongyi Lab (including CosyVoice, Paraformer, SenseVoice, etc.) can be called via the Alibaba Cloud Model Studio API service to achieve speech recognition (speech-to-text), speech synthesis (text-to-speech), and other functions. Combined with the large language model API services on Alibaba Cloud Model Studio (including Qwen, Baichuan, Moonshot AI, 01.AI, MiniMax, etc.), these functions can further realize voice chat dialogue, voice analysis and understanding, voice translation, and other advanced AI capabilities.
To run the example code in this code repository, you need to call the Alibaba Cloud Model Studio model service, which provides a certain amount of free quota for developers to trial various models. To obtain the free trial quota and run the example code in this repository, developers only need to follow the four steps below to meet the prerequisites:
- Open an Alibaba Cloud account
- Activate the Alibaba Cloud Model Studio model service
- Create an Alibaba Cloud Model Studio API-KEY and configure it as an environment variable
- Install the Alibaba Cloud Model Studio SDK (DashScope SDK)
-
You need to open an Alibaba Cloud account to use the Alibaba Cloud Model Studio model service. For instructions on opening an Alibaba Cloud account, see Open an Alibaba Cloud Account.
-
After logging in to your Alibaba Cloud account, you also need to activate the Alibaba Cloud Model Studio model service. For instructions on activating the Alibaba Cloud Model Studio model service, see Activate Alibaba Cloud Model Studio Large Model Service Platform.
-
All models on the Alibaba Cloud Model Studio service are called using a unified API-KEY. You need to create your own API-KEY through the console. For instructions on creating an Alibaba Cloud Model Studio API-KEY, see API-KEY Management.
By configuring the API-KEY in environment variables, you can avoid specifying the API-KEY explicitly in plaintext when running example code, thereby reducing the risk of API-KEY leakage. For instructions on configuring the API-KEY via environment variables, see Configure API-KEY Through Environment Variables.
-
-
Prerequisites
Python 3.8 or higher is installed.
-
Steps
pip3 install dashscope
-
Prerequisites
JDK 1.8 or higher is installed. For the version of the DashScope Java SDK, see Maven.
-
Steps
Execute the following command to depend on the Java SDK, replacing
the-latest-versionwith the latest version.<dependency> <groupId>com.alibaba</groupId> <artifactId>dashscope-sdk-java</artifactId> <version>the-latest-version</version> </dependency>
Or install via Gradle.
// https://mvnrepository.com/artifact/com.alibaba/dashscope-sdk-java implementation group: 'com.alibaba', name: 'dashscope-sdk-java', version: 'the-latest-version'
-
After successfully completing the above steps, please refer to the Application Scenarios and Development Examples section to choose an example to run based on your interested application scenario.
