RealtimeDialogAssist

Updated at:

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.

Try it now

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 resources is 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.

ActionAccess levelResource typeCondition keyRelated operation
dianjin:RealtimeDialogAssistnone
*All resources
*
    None
None

Request syntax

POST /{workspaceId}/api/realtime/dialog/assist HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
workspaceIdstringYes

Workspace ID

llm-xxxxx
bodyobjectNo

Request body parameters.

requestIdstringYes

Request ID

0FC6636E-380A-5369-AE01-D1C15BB9B254
bizTypestringYes

Business type. Currently, only dialogAssist is supported.

dialogAssist
analysisbooleanNo

Whether to analyze

false
metaDataobjectNo

metaData

{ "phoneTailNumber": "Phone tail number: 98X1", "preScreeningQuota": "Pre-screening quota: 30,000", "generalInterest": "Platform general interest rate: 20.4%" }
conversationModelarray<object>Yes

Dialog list

conversationModelobjectNo

Dialog

roleintegerYes

Role. 0 indicates the customer, and 1 indicates the agent.

0
customerServiceTypestringNo

Agent type. 0: robot, 1: human.

0
customerServiceIdstringNo

Customer service ID

1374683645635
customerIdstringNo

Unique identifier of the dialog role

98457834685635
contentstringYes

Specific content of the dialog

Hello
typestringNo

Type of the dialog content. Currently, only text is supported.

text
beginTimestringNo

Start time of this utterance

2025-12-12 09:00:00
beginintegerNo

Start time of this utterance, an offset in milliseconds relative to the session start point

1
endintegerNo

End time of this utterance, an offset in milliseconds relative to the session start point

1
sessionIdstringYes

Session ID

1915593248420413441
dialogMemoryTurnsintegerNo

Number of historical session turns carried

0
userVadbooleanNo

Whether the user interrupted

true
scriptContentPlayedstringNo

Portion of the previous agent script that has been broadcast

Hello
hangUpDialogbooleanNo

Hang up the session

false

Response elements

ElementTypeDescriptionExample
object

ResultCode

successboolean

Whether successful

true
dataTypestring

Data type

null
timestring

Timestamp

2024-04-24 11:54:34
errCodestring

Error code

0
messagestring

Error message

ok
dataobject

Response data

requestIdstring

Unique request ID. This request ID is the same as the request ID in the input parameters.

0FC6636E-380A-5369-AE01-D1C15BB9B254
sessionIdstring

Session ID

"1915593248420413441"
interruptboolean

Whether interrupted

true
conversationModelarray<object>

Current dialog content

conversationModelobject

Specific content of the dialog

rolestring

Role. 0 indicates the customer, and 1 indicates the agent.

"0"
customerServiceTypestring

Agent type. 0: robot, 1: human.

"0"
customerServiceIdstring

Customer service ID

"1374683645635"
customerIdstring

Unique identifier of the dialog role

"98457834685635"
contentstring

Specific content of the dialog

Hello
typestring

Type of the dialog content

text
assistScriptsarray<object>

List of script assist results

assistScriptobject

Script assist result

intentCodestring

Intent code

"1920005488515465216"
intentNamestring

Intent name

Polite Q&A
intentLabelsstring

Intent labels

null
assistScriptstring

Recommended script

You can respond according to the SOP flow.
isDefaultboolean

Whether intent escape occurred

true
assistSoparray<object>

List of flow assist results

assistSopobject

Flow assist result

intentCodestring

Intent code

XXX
intentNamestring

Intent name

XXX
assistSopstring

Recommended flow

XXX
isDefaultboolean

Whether intent escape occurred

true
analysisProcessstring

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

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
costlong

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 timeChange summaryOperation
2026-01-07OpenAPI response structure changedView change details