This topic describes the API operations related to AUI Kits for real-time interaction with intelligent agents.
GenerateAIAgentCall
Creates an intelligent agent instance. This operation is applicable to the integration solution based on AICallKit SDK or Alibaba Real-Time Communication (ARTC) SDK.
Usage notes
Request protocol: HTTP or HTTPS
Request path: /api/v1/aiagent/GenerateAIAgentCall
Whether authorization is required: Yes
Request method: POST
Content-Type: JSON
Request parameters
Parameter | Type | Required | Example | Description |
Parameter | Type | Required | Example | Description |
ai_agent_id | String | No | 39f8e0bc005e4f309379701645f4**** | The ID of the intelligent agent. |
expire | integer | No | 24 | The time when the token expires. Unit: hours. Default value: 24. |
user_id | String | No | useridxxxx | The user ID. |
template_config | String | Yes | {"VoiceChat": {"VoiceId": "your_voice_chat__id"}} | The configurations of the intelligent agent template. For more information, see AIAgentTemplateConfig. |
workflow_type | String | No | VoiceChat | The type of the intelligent agent. Valid values: VoiceChat AvatarChat3D VisionChat
|
Response parameters
Parameter | Type | Example | Description |
Parameter | Type | Example | Description |
code | Integer | 200 | The HTTP status code returned. |
rtc_auth_token | String | rtc_auth_tokenxxx | The Base64-encoded RTC token. |
ai_agent_id | String | ai_agent_idxxxx | The ID of the intelligent agent. |
ai_agent_user_id | String | ai_agent_user_idxxxx | The ID of the intelligent agent user. |
channel_id | String | channel_idxxxx | The ID of the channel. |
workflow_type | String | VoiceChat | The type of the intelligent agent. |
ai_agent_instance_id | String | ai_agent_instance_idxxx | The ID of the intelligent agent instance. |
Examples
Sample requests
{
"ai_agent_id":"30040ed7740b42f4a944bf6xxxxx",
"expire": 24,
"user_id": "12345678xxxx",
"template_config":"{}",
"workflow_type": "VoiceChat"
}
Sample success responses
{
"code": 200,
"rtc_auth_token": "eyJnc2xiIjpbImh0dHBzOi8vZ3cucnRuLmFsaXl1bmxxxxx",
"ai_agent_user_id":"xxx",
"channel_id": "fwfwqeqeqwewqxxx",
"workflow_type": "VoiceChat",
"ai_agent_id": "17e1c928bead40afb36f861d44c2fa0axxx",
"ai_agent_instance_id": "abcb1f5177b449329144b5f6578xxxx"
}
startAIAgentInstance
Starts an intelligent agent instance and joins an RTC call. This operation is applicable to the integration solution based on ARTC SDK.
Usage notes
Request protocol: HTTP or HTTPS
Request path: /api/v1/aiagent/startAIAgentInstance
Whether authorization is required: Yes
Request method: POST
Content-Type: JSON
Request parameters
Parameter | Type | Required | Example | Description |
Parameter | Type | Required | Example | Description |
user_id | String | Yes | useridxxxx | The user ID. |
template_config | String | No | {"VoiceChat": {"VoiceId": "your_voice_chat__id"}} | The configurations of the intelligent agent template. For more information, see AIAgentTemplateConfig. |
workflow_type | String | Yes | VoiceChat | The type of the intelligent agent. Valid values: VoiceChat AvatarChat3D VisionChat
|
Response parameters
Parameter | Type | Example | Description |
Parameter | Type | Example | Description |
code | Integer | 200 | The HTTP status code returned. |
ai_agent_instance_id | String | 513bbc1a2672*****1e2be | The ID of the intelligent agent instance. |
rtc_auth_token | String | xxxx | The Base64-encoded RTC token. |
ai_agent_user_id | String | xxxx | The ID of the intelligent agent user. |
channel_id | String | xxxx | The ID of the channel. |
Examples
Sample requests
{
"workflow_type":"VoiceChat",
"user_id": "12345xxxx",
"template_config":""
}
Sample success responses
{
"code": 200,
"rtc_auth_token": "eyJnc2xiIjpbImh0dHBzOixxxx",
"ai_agent_instance_id": "30040ed7740b42f4a944bf6f5bxxx",
"ai_agent_user_id": "97fcfc0b6dc74601903e570c6a82xxx",
"channel_id": "5abcd61c4fa24ed79dc7c1cb4a64xxxx"
}
stopAIAgentInstance
Stops an intelligent agent instance. This operation is applicable to the integration solution based on ARTC SDK.
Usage notes
Request protocol: HTTP or HTTPS
Request path: /api/v1/aiagent/stopAIAgentInstance
Whether authorization is required: Yes
Request method: POST
Content-Type: JSON
Request parameters
Parameter | Type | Required | Example | Description |
Parameter | Type | Required | Example | Description |
ai_agent_instance_id | String | Yes | 513bbc1a2672*****1e2be | The ID of the intelligent agent instance that you want to stop. |
Response parameters
Parameter | Type | Example | Description |
Parameter | Type | Example | Description |
code | Integer | 200 | The HTTP status code returned. |
result | Boolean | true | Indicates whether the request was successful. Valid values: true and false. |
Examples
Sample requests
{
"ai_agent_instance_id": "ff22f767-0471-4ef4-8aee-2xxxxxx"
}
Sample success responses
{
"code": "200",
"result": true
}
updateAIAgentInstance
Modifies the configurations of an intelligent agent instance, such as the voice and greeting. This operation is applicable to the integration solution based on ARTC SDK.
Usage notes
Request protocol: HTTP or HTTPS
Request path: /api/v1/aiagent/updateAIAgentInstance
Whether authorization is required: Yes
Request method: POST
Content-Type: JSON
Request parameters
Parameter | Type | Required | Example | Description |
Parameter | Type | Required | Example | Description |
ai_agent_instance_id | String | Yes | 513bbc1a2672*****1e2be | The ID of the intelligent agent instance whose configurations you want to modify. |
template_config | String | Yes | {"VoiceChat": {"VoiceId": "your_voice_chat__id"}} | The configurations of the intelligent agent template. For more information, see AIAgentTemplateConfig. |
Response parameters
Parameter | Type | Example | Description |
Parameter | Type | Example | Description |
code | Integer | 200 | The HTTP status code returned. |
result | Boolean | true | Indicates whether the request was successful. Valid values: true and false. |
Examples
Sample requests
{
"ai_agent_instance_id": "513bbc1a2672667bxxxx33b8fa0c9a88xxxxxx",
"template_config": "{\"xxx\":\"xxxx\"}"
}
Sample success responses
{
"code": "200",
"result": true
}