Learn about the data types used in the iOS SDK for AI chat agents.
Overview
|
Structure type |
Data type |
Description |
|
Enum |
Agent connection state. |
|
|
Agent response state. |
||
|
Agent message state. |
||
|
Message type. |
||
|
Message playback state. |
||
|
Class |
User information. |
|
|
Agent information. |
||
|
Authentication information object. |
||
|
Template configuration parameters for message conversations. |
||
|
Shared configuration for the agent. |
||
|
Agent message object. |
||
|
Request object for sending a message. |
||
|
Request object for querying message history. |
Data structure details
Enum
ARTCAIChatEngineState
Agent connection state.
|
Enum value |
Value |
Description |
|
Init |
0 |
Unconnected. |
|
Connecting |
1 |
Connecting. |
|
Connected |
2 |
Connected. |
|
Disconnect |
3 |
Disconnected. |
ARTCAIChatAgentResponseState
Agent response state.
|
Enum value |
Value |
Description |
|
Listening |
1 |
Listening. |
|
Thinking |
2 |
Thinking. |
|
Replying |
3 |
Replying. |
ARTCAIChatMessageState
Agent message state.
|
Enum value |
Value |
Description |
|
Init |
1 |
Initial state. |
|
Transfering |
2 |
Transferring (sending/receiving). |
|
Printing |
3 |
Printing (streaming response). |
|
Interrupted |
4 |
Interrupted. |
|
Finished |
5 |
Finished. |
|
Failed |
6 |
Failed. |
ARTCAIChatMessageType
Message type.
|
Enum value |
Value |
Description |
|
Text |
0 |
Text message. |
|
Voice |
1 |
Voice message (push-to-talk). |
ARTCAIChatMessagePlayState
Message playback state.
|
Enum value |
Value |
Description |
|
Init |
0 |
Initial state. |
|
Playing |
1 |
Playing. |
|
Stopped |
2 |
Playback stopped. |
|
Failed |
3 |
Playback failed. |
Class
ARTCAIChatUserInfo
User information object.
|
Property name |
Type |
Description |
|
userId |
String |
The user ID. |
|
deviceId |
String? |
The device ID. |
ARTCAIChatAgentInfo
Agent information object.
|
Property name |
Type |
Description |
|
agentId |
String |
The agent ID. |
|
region |
String |
The region where the agent service is located. Defaults to the China (Shanghai) region. |
ARTCAIChatAuthToken
Authentication information object.
|
Property name |
Type |
Description |
|
appId |
String |
Application ID. |
|
appSign |
String |
Application signature. |
|
token |
String |
Authentication token. |
|
timestamp |
Int |
Expiration timestamp. |
|
role |
String? |
Role. If "admin", the user can call management APIs. |
|
nonce |
String? |
Max length of 64 bytes. Allowed characters: letters, digits, and underscores (_). Optional. |
ARTCAIChatTemplateConfig
Template configuration parameters for a message conversation.
|
Property name |
Type |
Description |
|
bailianAppParams |
[String: Any]? |
Parameters for the Alibaba Cloud Model Studio application. |
|
agentVoiceId |
String? |
Voice ID for the agent. If not specified, the default voice configured for the agent is used. |
ARTCAIChatAgentShareConfig
Shared configuration for the agent.
|
Property name |
Type |
Description |
|
shareId |
String? |
Agent share ID. |
|
expireTime |
Date? |
Expiration time. |
|
region |
String? |
Service region. |
ARTCAIChatMessage
Agent message object.
|
Property name |
Type |
Description |
|
dialogueId |
String |
Message ID. |
|
isDialogueEnd |
Bool |
Indicates whether the current dialogue turn has finished. |
|
nodeId |
String? |
For a sub-message, this is its Node ID. |
|
requestId |
String |
Conversation turn ID. |
|
messageState |
Message state. |
|
|
messageType |
Message type. |
|
|
text |
String |
Original text content. |
|
isEnd |
Bool |
Indicates whether the current message has finished. |
|
senderId |
String? |
Sender identifier. Valid values: user, agent. |
|
sendTime |
TimeInterval |
Message send time. |
|
source |
String? |
Message source: "chat" (chatbot) or "call" (A/V call agent). |
|
sourceType |
String? |
Message type, which varies by scenario. A/V call: greeting / normal / speech Message conversation: normal / announcement / custom |
|
reasoningText |
String? |
Content generated during the reasoning phase. |
|
isReasoningEnd |
Bool |
Indicates whether the reasoning phase has ended. |
|
attachmentList |
[ARTCAIChatAttachment]? |
List of attachments. |
|
extend |
String? |
Custom extended information. |
ARTCAIChatSendMessageRequest
Request object for sending a message.
|
Property name |
Type |
Description |
|
requestId |
String |
Request ID. |
|
messageType |
Message type. |
|
|
text |
String |
Raw text content. Cannot be nil if |
|
attachmentUploader |
ARTCAIChatAttachmentUploader? |
Attachment uploader. |
ARTCAIChatMessageListRequest
Request object for querying message history.
|
Property name |
Type |
Description |
|
startTime |
TimeInterval |
Start Unix timestamp (exclusive), in seconds. |
|
endTime |
TimeInterval |
End Unix timestamp (inclusive), in seconds |
|
pageNumber |
Int |
The page number. |
|
pageSize |
Int |
Page size. Max: 100, Default: 20. |
|
isDesc |
Bool |
Specifies whether to sort in descending order. Default value: true. |