RunTitleGeneration
Miaobi generates titles.
Debugging
You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
RAM authorization
The following table describes the authorization information for this API, which can be used in the Action element of a RAM permission policy statement to grant RAM users or RAM roles the permission to call this API. Details are as follows:
-
Operation: the specific permission point.
-
Access level: the access level of each operation. Valid values: Write, Read, or List.
-
Resource type: the resource types that support authorization for the operation. Details are as follows:
- Required resource types are marked with a preceding *.
- For operations that do not support resource-level authorization,
全部资源is used.
-
Condition key: the condition keys defined by the cloud service itself.
-
Dependent operation: other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions for the operation to succeed.
| Operation | Access level | Resource type | Condition key | Dependent operation |
|---|---|---|---|---|
| aimiaobi:RunTitleGeneration | create | *All Resources * |
| None |
Request syntax
POST /quanmiao/aimiaobi/runTitleGeneration HTTP/1.1
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The unique identifier of the Alibaba Cloud Model Studio workspace. For more information, see Workspace ID. | llm-xxx |
| ReferenceData | object | Yes | Data for title generation. | |
| Contents | array | Yes | List of main content. | |
| string | Yes | Main content. | xxx | |
| TaskId | string | No | The unique identifier of the associated creative article. Note By default, you do not need to specify TaskId. The system automatically generates it. If subsequent tasks use the same TaskId, the tasks belong to the same conversation group. | xxxx |
| TitleCount | string | No | Number of titles to generate, up to 10. | 10 |
| DeduplicatedTitles | array | No | The collection of titles that the newly generated titles need to be deduplicated against. The total character count of all titles must not exceed 5K. | |
| string | No | The title to deduplicate. | Title xxxx |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| object | Schema of Response | ||
| Header | object | Response header. | |
| ErrorCode | string | Error code. | AccessForbid |
| ErrorMessage | string | Error code message. | xxx |
| Event | string | SSE event. | task-failed |
| SessionId | string | Session ID | 3f7045e099474ba28ceca1b4eb6d6e21 |
| StatusCode | integer | Status code. | 400 |
| TaskId | string | Task ID | 50a1cc8e-717e-4a2b-a76b-dc9734a8564b |
| TraceId | string | Full link ID. | 0a3d448f17000139741898287e0eb3 |
| Payload | object | Response body. | |
| Output | object | Output. | |
| Text | string | Article title. | xxx |
| Usage | object | Token usage. | |
| InputTokens | long | Number of tokens used for input. | 1 |
| OutputTokens | long | Number of tokens used for output. | 1 |
| TotalTokens | long | Total number of tokens used for this call. | 2 |
| RequestId | string | Unique request identifier. | 94512A33-8EC1-5452-A793-5C91F18ED2F0 |
| HttpStatusCode | string | HTTP status code. | 200 |
| Code | string | Status code. | AccessForbid |
| Message | string | Error description. | Data does not exist |
| Success | boolean | Whether the operation is successful: true for success, false for failure. | true |
Examples
Normal response example
JSON format
{
"Header": {
"ErrorCode": "AccessForbid",
"ErrorMessage": "xxx",
"Event": "task-failed",
"SessionId": "3f7045e099474ba28ceca1b4eb6d6e21",
"StatusCode": 400,
"TaskId": "50a1cc8e-717e-4a2b-a76b-dc9734a8564b",
"TraceId": "0a3d448f17000139741898287e0eb3"
},
"Payload": {
"Output": {
"Text": "xxx"
},
"Usage": {
"InputTokens": 1,
"OutputTokens": 1,
"TotalTokens": 2
}
},
"RequestId": "94512A33-8EC1-5452-A793-5C91F18ED2F0",
"HttpStatusCode": 200,
"Code": "AccessForbid",
"Message": "数据不存在",
"Success": true
}
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 403 | NoPermission | You are not authorized to perform this action. | Please check the workspaceId assignment |
Visit the Error Center to view more error codes.