RealtimeDialogAssist
Provides real-time dialog assistance after a session is created using CreateDialog. Note: This operation returns multiple intents, tags, and SOP flows. Unlike real-time sessions, it does not support streaming responses.
Operation description
Before you use this API, make sure that you fully understand the billing methods and pricing of the Model Studio DianJin service.
Prerequisites
Activate the Alibaba Cloud Model Studio and Model Studio DianJin services.
Obtain workspaceId: Obtain the workspace identity.
Try it now
You can directly run this API in OpenAPI Explorer, which saves 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 of the API. You can use it in the Action element of a RAM policy statement to grant RAM users or RAM roles the permission to call this API. Details:
-
Action: the specific permission point.
-
Access level: the access level of each operation. Valid values: Write, Read, and List.
-
Resource type: the resource types that support authorization in the operation. Details:
- Required resource types are marked with a leading asterisk (*).
- For operations that do not support resource-level authorization,
All resourcesis used.
-
Condition key: the condition keys defined by the cloud service itself.
-
Related operation: other permissions required to successfully perform the operation. The operator must also have the permissions of related operations for the operation to succeed.
| Action | Access level | Resource type | Condition key | Related operation |
|---|---|---|---|---|
| dianjin:RealtimeDialogAssist | none | *All resources * |
| None |
Request syntax
POST /{workspaceId}/api/realtime/dialog/assist HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| workspaceId | string | Yes | Workspace ID | llm-xxxxx |
| body | object | No | Request body parameters. | |
| requestId | string | Yes | Request ID | 0FC6636E-380A-5369-AE01-D1C15BB9B254 |
| bizType | string | Yes | Business type. Currently, only dialogAssist is supported. | dialogAssist |
| analysis | boolean | No | Whether to analyze | false |
| metaData | object | No | metaData | { "phoneTailNumber": "Phone tail number: 98X1", "preScreeningQuota": "Pre-screening quota: 30,000", "generalInterest": "Platform general interest rate: 20.4%" } |
| conversationModel | array<object> | Yes | Dialog list | |
| conversationModel | object | No | Dialog | |
| role | integer | Yes | Role. 0 indicates the customer, and 1 indicates the agent. | 0 |
| customerServiceType | string | No | Agent type. 0: robot, 1: human. | 0 |
| customerServiceId | string | No | Customer service ID | 1374683645635 |
| customerId | string | No | Unique identifier of the dialog role | 98457834685635 |
| content | string | Yes | Specific content of the dialog | Hello |
| type | string | No | Type of the dialog content. Currently, only text is supported. | text |
| beginTime | string | No | Start time of this utterance | 2025-12-12 09:00:00 |
| begin | integer | No | Start time of this utterance, an offset in milliseconds relative to the session start point | 1 |
| end | integer | No | End time of this utterance, an offset in milliseconds relative to the session start point | 1 |
| sessionId | string | Yes | Session ID | 1915593248420413441 |
| dialogMemoryTurns | integer | No | Number of historical session turns carried | 0 |
| userVad | boolean | No | Whether the user interrupted | true |
| scriptContentPlayed | string | No | Portion of the previous agent script that has been broadcast | Hello |
| hangUpDialog | boolean | No | Hang up the session | false |
Response elements
| Element | Type | Description | Example |
|---|---|---|---|
| object | ResultCode | ||
| success | boolean | Whether successful | true |
| dataType | string | Data type | null |
| time | string | Timestamp | 2024-04-24 11:54:34 |
| errCode | string | Error code | 0 |
| message | string | Error message | ok |
| data | object | Response data | |
| requestId | string | Unique request ID. This request ID is the same as the request ID in the input parameters. | 0FC6636E-380A-5369-AE01-D1C15BB9B254 |
| sessionId | string | Session ID | "1915593248420413441" |
| interrupt | boolean | Whether interrupted | true |
| conversationModel | array<object> | Current dialog content | |
| conversationModel | object | Specific content of the dialog | |
| role | string | Role. 0 indicates the customer, and 1 indicates the agent. | "0" |
| customerServiceType | string | Agent type. 0: robot, 1: human. | "0" |
| customerServiceId | string | Customer service ID | "1374683645635" |
| customerId | string | Unique identifier of the dialog role | "98457834685635" |
| content | string | Specific content of the dialog | Hello |
| type | string | Type of the dialog content | text |
| assistScripts | array<object> | List of script assist results | |
| assistScript | object | Script assist result | |
| intentCode | string | Intent code | "1920005488515465216" |
| intentName | string | Intent name | Polite Q&A |
| intentLabels | string | Intent labels | null |
| assistScript | string | Recommended script | You can respond according to the SOP flow. |
| isDefault | boolean | Whether intent escape occurred | true |
| assistSop | array<object> | List of flow assist results | |
| assistSop | object | Flow assist result | |
| intentCode | string | Intent code | XXX |
| intentName | string | Intent name | XXX |
| assistSop | string | Recommended flow | XXX |
| isDefault | boolean | Whether intent escape occurred | true |
| analysisProcess | string | Analysis process | The content of the customer's reply does not match any description in the provided intent list, and does not express any specific need or question about bills, repayment, weather, or other services. |
| requestId | string | Request ID. This request ID is recorded by the system. If issues occur, provide this ID to the Model Studio DianJin R&D team for troubleshooting. | 67C7021A-D268-553D-8C15-A087B9604028 |
| cost | long | Time consumed | null |
Examples
Success response
JSON format
{
"success": true,
"dataType": null,
"time": "2024-04-24 11:54:34",
"errCode": 0,
"message": "ok",
"data": {
"requestId": "0FC6636E-380A-5369-AE01-D1C15BB9B254",
"sessionId": 1915593248420413400,
"interrupt": true,
"conversationModel": [
{
"role": 0,
"customerServiceType": 0,
"customerServiceId": 1374683645635,
"customerId": 98457834685635,
"content": "你好",
"type": "text"
}
],
"assistScripts": [
{
"intentCode": 1920005488515465200,
"intentName": "礼貌问答",
"intentLabels": null,
"assistScript": "可按照SOP流程回应。",
"isDefault": true
}
],
"assistSop": [
{
"intentCode": "XXX",
"intentName": "XXX",
"assistSop": "XXX",
"isDefault": true
}
],
"analysisProcess": "客户回答的内容与提供的意图列表描述均不匹配,没有表达出对账单、还款、天气或其他服务的具体需求或问题。"
},
"requestId": "67C7021A-D268-553D-8C15-A087B9604028",
"cost": 0
}
Error codes
Visit the Error Center to view more error codes.
Change history
| Change time | Change summary | Operation |
|---|---|---|
| 2026-01-07 | OpenAPI response structure changed | View change details |