Skip to main content

RecognizeIntention

Detects intents. This operation supports global and hierarchical intent detection, attitude detection, and enterprise detection.

Operation description

Make sure that you fully understand the billing methods and pricing of Tongyi Dianjin before you use this operation. Prerequisites
  • Model Studio and Tongyi Dianjin have been activated.
  • You have obtained a workspaceId: Obtain the workspace ID.

Debug

You can run this operation directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After the operation runs successfully, OpenAPI Explorer can automatically generate SDK code examples. Debug

RAM authorization

The following table describes the authorization information of the API. You can use the Action element in RAM permission policy statements to grant RAM users or RAM roles the permission to call this API. Details are as follows:
  • Action: refers to a specific permission point.
  • Access level: refers to the access level of each operation. Valid values: Write, Read, or List.
  • Resource type: refers to the resource types supported for authorization in the operation. Details are as follows:
    • Required resource types are marked with a preceding asterisk (*).
    • For operations that do not support resource-level authorization, All Resources is used.
  • Condition key: refers to the condition keys defined by the cloud service itself.
  • Dependent action: refers to other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions before the operation can succeed.
ActionAccess levelResource typeCondition keyDependent action
dianjin:RecognizeIntentionnone
*All Resources
*
    None
None

Request syntax

POST /{workspaceId}/api/recog/intent HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
workspaceIdstringYes

Workspace ID.

llm-xxxx
bodyobjectNo

Request body.

analysisbooleanNo

Whether to analyze.

false
bizTypestringYes

Business type.

Valid values:
  • common: Intent detection.
  • business: Enterprise detection.
  • attitude: Attitude detection.
common
conversationstringYes

Conversation content.

##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?
globalIntentionListarray<object>No

Global intent list. Required when the operation type opType is hierarchical.

globalIntentionListobjectNo

Global intent.

descriptionstringNo

Intent description.

Normal payment 3
intentionstringNo

Intent name.

Normal payment 3
intentionCodestringNo

Intent code.

1810566978021232640
intentionScriptstringNo

Intent script.

Alright, I will not disturb you further. Wishing you a pleasant life. Goodbye!
hierarchicalIntentionListarray<object>No

Hierarchical intent list. Required when the operation type opType is hierarchical.

hierarchicalIntentionListobjectNo

Hierarchical intent.

descriptionstringNo

Intent description.

Ask about stock price
intentionstringNo

Intent name.

Ask about stock price
intentionCodestringNo

Intent code.

1810929291010150400
intentionScriptstringNo

Intent script.

Alright, I will not disturb you further. Wishing you a pleasant life. Goodbye!
intentionListarray<object>No

Intent list. Required when the business type is not attitude detection.

intentionListobjectNo

Intent.

descriptionstringNo

Intent description.

Customer indicates they forgot to repay
intentionstringNo

Intent name.

Customer indicates they forgot to repay
intentionCodestringNo

Intent code.

1808766224000262144
intentionScriptstringNo

Intent script.

Alright, I will not disturb you further. Wishing you a pleasant life. Goodbye!
opTypestringNo

Operation type.

Valid values:
  • common: Common.
  • hierarchical: Hierarchical.
common
recommendbooleanNo

Recommended intent.

false
intentionDomainCodestringNo

Intent library: local intent library code.

collection

Response elements

ElementTypeDescriptionExample
object

Result code

costlong

Processing time.

null
dataobject

Response data.

analysisProcessstring

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.
intentionCodestring

Intent code.

-1
intentionNamestring

Intent name.

Other
recommendIntentionstring

Recommended intent.

The customer is trying to avoid discussing the topic of overdue repayment
recommendScriptstring

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.
intentionScriptstring

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.
dataTypestring

Data type.

null
errCodestring

Error code.

0
messagestring

Error message.

ok
requestIdstring

Request ID.

003D019A-1BB3-53EC-A0D2-CE76DA5D73B1
successboolean

Indicates whether the request is successful.

true
timestring

Timestamp.

2024-04-24 11:54:34

Examples

Normal response example JSON format
{
  "cost": 0,
  "data": {
    "analysisProcess": "客户回答的内容与提供的意图列表描述均不匹配,没有表达出对账单、还款、天气或其他服务的具体需求或问题。",
    "intentionCode": -1,
    "intentionName": "其它",
    "recommendIntention": "客户试图回避谈论逾期还款的话题",
    "recommendScript": "朱先生,理解您可能对天气感兴趣,但更重要的是您的账户情况。请让我们专注于您未偿还的款项,这对您的信用健康至关重要。",
    "intentionScript": "朱先生,理解您可能对天气感兴趣,但更重要的是您的账户情况。请让我们专注于您未偿还的款项,这对您的信用健康至关重要。"
  },
  "dataType": null,
  "errCode": 0,
  "message": "ok",
  "requestId": "003D019A-1BB3-53EC-A0D2-CE76DA5D73B1",
  "success": true,
  "time": "2024-04-24 11:54:34"
}

Error codes

Visit the Error Center to view more error codes.

Release notes

Change timeChange summaryOperation
No change history yet.