CreateTask - Create a car purchase customer portrait task
API reference for creating car purchase customer portrait tasks.
Prerequisites
Activate the service and obtain and configure an API key. To prevent security risks from code leaks, configure the API key as an environment variable instead of hard coding it in your code.
NoteTo 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.
Endpoint
https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
Request method
POST request
Request headers
Authorization: Bearer {api-key} // Replace {api-key} with your actual API key.
Content-Type: application/json
Create a task
Creates a car purchase customer portrait analysis task.
Request parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
model | string | Yes | The business type. Set the value to tingwu-automotive-customer-profile. | tingwu-automotive-customer-profile |
input | object | Yes | Specify the relevant business parameters. | |
input.fileUrl | string | One of three required | 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 |
input.text | string | The text to be analyzed. | Each line must be in the following format: ${Speaker Name}: ${Speaker Content} For example: | |
input.dataId | string | Associating uploaded and parsed tasks | ||
input.appId | string | Yes | The application ID. | |
input.task | string | Yes | The task type. Set the value to createTask to create a task. | createTask |
parameters | object | No | The control parameters for the customer portrait. | |
parameters.identityRecognition | object | No | The role settings. | |
parameters.identityRecognition.identityContents | list[] | Yes | A list of role settings. Each setting includes a role name and description. The list can contain a maximum of 5 items. | |
parameters.identityRecognition.identityContents[i].Name | string | Yes | The name of the role. | Customer |
parameters.identityRecognition.identityContents[i].Description | string | Yes | The description of the role. | Asks questions about the vehicle and expresses feelings about using it. |
parameters.contentExtraction | object | No | The parameter object for extracting the customer's detailed points of interest. | |
parameters.contentExtraction.extractionContents | list[] | Yes | A list of extraction dimensions for the customer's detailed points of interest. Each dimension includes an item name and definition. The number of items cannot exceed 150. | |
parameters.contentExtraction.extractionContents[i].title | string | Yes | The name of the extraction dimension for the customer's detailed points of interest. | Order-related |
parameters.contentExtraction.extractionContents[i].content | string | Yes | The definition of the extraction dimension for the customer's detailed points of interest. | How long does it take for a custom color? |
parameters.contentExtraction.extractionContents[i].identity | string | Yes | The name of the customer's role. | Customer |
Response parameters
Name | Type | Description | Example |
|---|---|---|---|
output | object | ||
output.dataId | string | The task ID. | lsA*** |
output.status | string | The task status:
| 0 |
usage | object | The usage details. | {} |
code | string | The error code. | InvalidParameter |
message | string | The error message. | Agent Input text format error. |
request_id | string | The request ID. | f97ee37d-0f9c-9b93-b6bf-bd263a232bf9 |
Request example
Replace "sk-***" in the Authorization request header with your actual Alibaba Cloud Model Studio API key.
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
--header 'Authorization: Bearer sk-***' \
--header 'Content-Type: application/json' \
--data '{
"model": "tingwu-automotive-customer-profile",
"input": {
"task": "createTask",
"text": "Zhang3:I want to buy an SUV\nLi4:What price range are you looking for?",
"appId": "tw_***"
},
"parameters": {
"identityRecognition": {
"identityContents": [
{
"name": "***",
"description": "Introduces different vehicle configurations, performance, technology, comfort, and convenience."
},
{
"name": "***",
"description": "Asks questions about the vehicle and expresses feelings about using it."
}
]
},
"contentExtraction": {
"extractionContents": [
{
"title": "***",
"content": "Basic vehicle information",
"identity": "The customer asks about vehicle model parameters and technical configurations, and the sales representative provides detailed parameter information."
}
]
}
}
}'
Response example
{
"output": {
"dataId": "Foi***"
},
"usage": {},
"request_id": "95edfcc7-0481-90aa-884b-3ebf3603b6f8"
}