Detects intents. This operation supports global and hierarchical intent detection, attitude detection, and enterprise detection.
Operation description
Before you use this operation, review the billing methods and pricing of Alibaba Cloud Tongyi Dianjin.
Prerequisites
- You have activated Alibaba Cloud Model Studio and Tongyi Dianjin.
- You have obtained a workspace ID.
Try it now
Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.
RAM authorization
The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:
-
Action: The actions can be used in the
Actionelement of RAM permission policy statements to grant permissions to perform the operation. - API: The API that you can call to perform the action.
- Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.
-
Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.
- For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
Resourceelement of the policy. - For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the
Resourceelement of the policy.
- For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
- Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.
- Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.
Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
dianjin:RecognizeIntention | none | *All Resource
| None | None |
Request syntax
Path Parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| workspaceId | string | Yes | Workspace ID. | llm-xxxx |
Request parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| body | object | No | Request body. | |
| analysis | boolean | No | Enable analysis. | false |
| bizType | string | Yes | Business type. Valid values:
| common |
| conversation | string | Yes | Conversation text. | ##Agent##: Hello, is this Mr. Zhu Jie? This is Zhou Li from Chengxin Finance. We noticed that one of your payments had a billing date yesterday, but you have not yet made the repayment. This may be a small oversight. I am calling to remind you to complete the repayment as soon as possible to avoid affecting your credit record.\n ##Customer##: How is the weather today? |
| globalIntentionList | array<object> | No | Global intent list. Required when opType is hierarchical. | |
object | No | Global intent. | ||
| description | string | No | Intent description. | Normal payment 3 |
| intention | string | No | Intent name. | Normal payment 3 |
| intentionCode | string | No | Intent code. | 1810566978021232640 |
| intentionScript | string | No | Intent script. | Alright, I will not disturb you further. Wishing you a pleasant life. Goodbye! |
| hierarchicalIntentionList | array<object> | No | Hierarchical intent list. Required when opType is hierarchical. | |
object | No | Hierarchical intent. | ||
| description | string | No | Intent description. | Ask about stock price |
| intention | string | No | Intent name. | Ask about stock price |
| intentionCode | string | No | Intent code. | 1810929291010150400 |
| intentionScript | string | No | Intent script. | Alright, I will not disturb you further. Wishing you a pleasant life. Goodbye! |
| intentionList | array<object> | No | Intent list. Required when bizType is not attitude. | |
object | No | Intent. | ||
| description | string | No | Intent description. | Customer indicates they forgot to repay |
| intention | string | No | Intent name. | Customer indicates they forgot to repay |
| intentionCode | string | No | Intent code. | 1808766224000262144 |
| intentionScript | string | No | Intent script. | Alright, I will not disturb you further. Wishing you a pleasant life. Goodbye! |
| opType | string | No | Operation type. Valid values:
| common |
| recommend | boolean | No | Recommend intent. | false |
| intentionDomainCode | string | No | Intent library: Local intent library code. | collection |
Response elements
Element | Type | Description | Example |
|---|---|---|---|
object | Result code. | ||
| cost | integer | Processing time in milliseconds. | null |
| data | object | Response data. | |
| analysisProcess | string | Analysis process. | The customer's reply does not match any description in the provided intent list, and does not express any specific need or question regarding bills, repayment, weather, or other services. |
| intentionCode | string | Intent code. | -1 |
| intentionName | string | Intent name. | Other |
| recommendIntention | string | Recommended intent. | The customer is trying to avoid discussing the topic of overdue repayment |
| recommendScript | string | Recommended script. | Mr. Zhu, I understand you may be interested in the weather, but more importantly, your account situation. Please let us focus on your outstanding payments, which are critical to your credit health. |
| intentionScript | string | Intent script. | Mr. Zhu, I understand you may be interested in the weather, but more importantly, your account situation. Please let us focus on your outstanding payments, which are critical to your credit health. |
| dataType | string | Data type. | null |
| errCode | string | Error code. | 0 |
| message | string | Error message. | ok |
| requestId | string | Request ID. | 003D019A-1BB3-53EC-A0D2-CE76DA5D73B1 |
| success | boolean | Indicates whether the request succeeded. | true |
| time | string | Timestamp. | 2024-04-24 11:54:34 |
Examples
Success response
JSON format