Skip to main content

RunCompletion

Call the Tongyi Xiaomi CCAI Conversation Analysis AIO application to obtain conversation summaries, key information extraction, quality inspection results, and conversation analysis results. This API supports HTTP calls and returns responses to clients. You can choose between the standard HTTP or HTTP Server-Sent Events (SSE) protocols.

Operation description

Before you use this API, review the pricing details for the Tongyi Xiaomi CCAI Conversation Analysis AIO service. Prerequisites
  1. You have activated the Tongyi Xiaomi CCAI Conversation Analysis AIO service.
  2. You have created a Tongyi Xiaomi CCAI Conversation Analysis AIO application in the Application Center and obtained the corresponding APP-ID and WORKSPACE-ID. For more information, see Get APP-ID and 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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /{workspaceId}/ccai/app/{appId}/completion HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

workspaceId

string

Yes

Workspace identifier

llm-ik******RVYCKzt

appId

string

Yes

Application ID

097d65c9c7004f8dad2b454850ac232b

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

Request body structure

Dialogue

object

Yes

Dialogue structure

Sentences

array<object>

No

List of dialogue messages

object

No

Structure of a single dialogue message

ChatId

string

No

Unique ID for a dialogue message

ae2483e01a8446aa859925947fcf4d8e

Role

string

Yes

Speaker role: user (customer), agent (agent), or system (system message)

user

Text

string

Yes

Dialogue message text

Query Beijing weather

SessionId

string

No

Unique ID for the entire dialogue session

d25zc9c7004f8dad2b454d

Fields

array<object>

No

List of fields to extract

array<object>

No

Field structure

Code

string

No

Field code

phoneNumber

Desc

string

No

Field description

Reason classification for the user's incoming call inquiry, mainly complaints, consultations, policy suggestions, etc.

EnumValues

array<object>

No

List of enumeration values

object

No

Enumeration value structure

Desc

string

No

Enumeration value description

The customer has new requirements/new scenarios, and the customer service follows up to communicate the requirement details

EnumValue

string

Yes

Enumeration value

New business expansion

Name

string

Yes

Field name

Reason for call type

ModelCode

string

No

Model specification

Valid values:

  • ccai-72b :
    ccai-72b
  • ccai-14b :
    ccai-14b

tyxmTurbo

ServiceInspection

object

No

Service quality inspection structure

InspectionContents

array<object>

No

List of service quality inspection dimensions

object

No

Service quality inspection dimension structure

Content

string

No

Description of a service quality inspection dimension

During the process of serving the customer, whether the customer service has over-promised based on existing service standards, e.g., the fastest delivery time is 12 hours, and a faster delivery time cannot be promised to the customer.

Title

string

Yes

Service quality inspection dimension name

Whether the customer service over-promises

InspectionIntroduction

string

No

Detailed description of the service quality inspection scenario

Please check whether the customer service has any improper behavior, including: over-promising, intentionally extracting customer privacy information, etc.

SceneIntroduction

string

No

Service quality inspection scenario

Insurance sales scenario

Stream

boolean

No

Set to true to enable SSE streaming responses. Default is false.

Valid values:

  • true :

    true

  • false :

    false

false

TemplateIds

array

Yes

List of template IDs in the CCAI application

integer

No

Template ID in the CCAI application

10375

variables

array<object>

No

List of variables

object

No

Variable list

variableCode

string

No

Variable code

name

variableValue

string

No

Variable value

Zhang San

responseFormatType

string

No

Response format type: jsonObject (JSON object) or text (raw string)

jsonObject

Response elements

Element

Type

Description

Example

object

Response structure

FinishReason

string

If streaming is enabled, this field is null while generating. When generation ends, it returns stop if stopped by a stop token.

stop

RequestId

string

System-generated unique ID for this request

17204B98-xxxx-4F9A-8464-2446A84821CA

Text

string

Response from the application

This conversation appears to be a discussion between the customer service and the customer about a service or product, but the specific content is difficult to understand clearly because the language in the conversation is fragmented and abstract.

inputTokens

string

Number of input tokens

4672

outputTokens

string

Number of output tokens

621

totalTokens

string

Total number of tokens

5609

usage

object

rag

object

dialogSummary

object

inputTokens

integer

outputTokens

integer

invokeCount

integer

adaptive

object

inputTokens

integer

outputTokens

integer

invokeCount

integer

ragStatus

string

Examples

Success response JSON format
{
  "FinishReason": "stop",
  "RequestId": "17204B98-xxxx-4F9A-8464-2446A84821CA\n",
  "Text": "这段对话似乎是客服与客户之间关于一个服务或产品的讨论,但具体内容难以明确理解,因为对话中的言语比较零散和抽象。\n",
  "inputTokens": "4672",
  "outputTokens": "621",
  "totalTokens": "5609",
  "usage": {
    "rag": {
      "dialogSummary": {
        "inputTokens": 0,
        "outputTokens": 0,
        "invokeCount": 0
      },
      "adaptive": {
        "inputTokens": 0,
        "outputTokens": 0,
        "invokeCount": 0
      }
    }
  },
  "ragStatus": ""
}

Error codes

HTTP status code

Error code

Error message

Description

400CCAI.InvalidParam.NotExistThe specified parameter %s is not valid.The request parameter does not exist.
400CCAI.Throttling.QpmTrigger QPM flow restriction. Please purchase higher QPM for paid API. If free API has special requirements, please contact us through DingTalk group (62730018475).Trigger QPM flow restriction. Please purchase higher QPM for paid API. If free API has special requirements, please contact us through DingTalk group (62730018475).
400CCAI.Throttling.QpsTrigger current QPS limit, pay API please buy higher QPS, the free API if you have special requirements, please contact us through the DingTalk group (62730018475).Trigger current limit, pay API please buy higher QPS, free API if you have special requirements, please contact us through the DingTalk group (62730018475).
400CCAI.ParamInvalid.IllegalParamValueThe parameter value of the request API is illegal %s.The parameter value of the request API is illegal.
500CCAI.InternalErrorThe request processing has failed due to some unknown error, exception or failure.
403CCAI.IllegalPermission.NoAuthUser not authorized to operate on the specified resource.The user is not authorized to operate the specified resource
403CCAI.ParamNotfound.MissParamParameter verification failed, The specified parameter %s is missing.Parameter validation failed. The specified parameter is missing.
403CCAI.TenantPermission.NoAuthThe current account does not have the permission to specify the business space. Please authorize the business space permission.The current account does not have the permission to specify the business space. Please authorize the business space permission.
See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.