RunTitleGeneration

Updated at:

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.

Debug

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.

OperationAccess levelResource typeCondition keyDependent operation
aimiaobi:RunTitleGenerationcreate
*All Resources
*
    None
None

Request syntax

POST /quanmiao/aimiaobi/runTitleGeneration HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample value
WorkspaceIdstringYes

The unique identifier of the Alibaba Cloud Model Studio workspace. For more information, see Workspace ID.

llm-xxx
ReferenceDataobjectYes

Data for title generation.

ContentsarrayYes

List of main content.

stringYes

Main content.

xxx
TaskIdstringNo

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
TitleCountstringNo

Number of titles to generate, up to 10.

10
DeduplicatedTitlesarrayNo

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.

stringNo

The title to deduplicate.

Title xxxx

Response parameters

NameTypeDescriptionExample value
object

Schema of Response

Headerobject

Response header.

ErrorCodestring

Error code.

AccessForbid
ErrorMessagestring

Error code message.

xxx
Eventstring

SSE event.

task-failed
SessionIdstring

Session ID

3f7045e099474ba28ceca1b4eb6d6e21
StatusCodeinteger

Status code.

400
TaskIdstring

Task ID

50a1cc8e-717e-4a2b-a76b-dc9734a8564b
TraceIdstring

Full link ID.

0a3d448f17000139741898287e0eb3
Payloadobject

Response body.

Outputobject

Output.

Textstring

Article title.

xxx
Usageobject

Token usage.

InputTokenslong

Number of tokens used for input.

1
OutputTokenslong

Number of tokens used for output.

1
TotalTokenslong

Total number of tokens used for this call.

2
RequestIdstring

Unique request identifier.

94512A33-8EC1-5452-A793-5C91F18ED2F0
HttpStatusCodestring

HTTP status code.

200
Codestring

Status code.

AccessForbid
Messagestring

Error description.

Data does not exist
Successboolean

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 codeError codeError messageDescription
403NoPermissionYou are not authorized to perform this action.Please check the workspaceId assignment

Visit the Error Center to view more error codes.