This topic describes the TingWu Python SDK to help developers quickly call the service.
Prerequisites
To grant temporary access permissions to third-party applications or users, or want to strictly control risky operations such as accessing or deleting sensitive data, you can use a temporary authentication token.Compared to a long-term API key, a temporary authentication token is valid for only a short period (60 seconds) and offers higher security. It is suitable for temporary call scenarios and can effectively reduce the risk of API key leaks.Usage: In your code, replace the API key used for authentication with the obtained temporary authentication token.
- Install the latest version of the DashScope SDK (The DashScope SDK version must be 1.24.1 or later, and the Python version must be 3.9 or later).
API description
TingWu.py
You can call the service using the call method of TingWu.py:
-
model
Name
Type
Required
Description
Example
model
string
Yes
Defines the business type.
For more information about the parameters, see the API reference.
tingwu-automotive-service-insights
-
user_defined_input
Name Type Required Description Example fileUrl string Select one of the three The OSS URL of the file to be analyzed. https://.oss-cn-hangzhou.aliyuncs.com/%E8%AF%95%E9%A9%BE%E6%A1%88%E4%BE%8Bsmall.wav?OSSAccessKeyId=YOUR_ACCESS_KEY_ID&Expires=&Signature=YOUR_SIGNATURE text string The text to be analyzed. Each line must be in the following format:${Speaker name}: ${Speaker content}For example: dataId string The ID of the task that has been uploaded and parsed. appId string Yes Application ID. task string Yes Task type: - createTask: Creates a task.
- getTask: Obtains the task result.
createTask - parameters (For more information, see the API reference.)
Sample code
Response
Using Automotive Service Insights as an example, the main response parameters are described as follows. For more information, see the Automotive Service Insights API Reference or the Customer Portrait for Car Purchase API Reference:
Name | Type | Description | Example |
|---|---|---|---|
output | object | ||
output.dataId | string | Task ID. | |
output.status | string |
| 0 |
usage | object | ||
code | string | Error code. | InvalidParameter |
message | string | Error message. | Agent Input text format error. |
request_id | string | Request ID. | f97ee37d-0f9c-9b93-b6bf-bd263a232bf9 |