This topic describes the syntax and provides examples for the tag categorization feature of the Tongyi Data Mining API.
Request syntax
Request parameters
Name | Type | Required | Description | Example value |
|---|---|---|---|---|
capabilityType | string | Yes | The type of capability. Tag classification: TAG_CLASSIFY | TAG_CLASSIFY |
userPrompt | string | Yes | The prompt. | Analyze the business scope of a company, extract key information, and provide the output in a structured format. Stop after the output is complete and do not add new content. |
fileIdList | array | Yes | A list of document IDs. | [ "file_zhiwen_XXX" ] |
stream | boolean | Yes | Specifies whether to return the response in a stream. | true |
Response parameters
Name | Type | Description |
|---|---|---|
output | object | |
-choices | array | |
-finishReason | string | The reason the process finished. |
-message | object | The message body. |
-role | string | The role. |
-content | string | The message content. |
requestId | string | The request ID. |
usage | object | Information about token usage. |
-inputTokens | int | The number of input tokens. |
-outputTokens | int | The number of output tokens. |
-totalTokens | int | The total number of tokens. |
Examples
Request example
Successful response example
JSON format