Real-time Conversational AI FAQ

更新时间:
复制 MD 格式

This FAQ answers common questions and offers solutions for Real-time Conversational AI.

FAQ

Features

Integration

Features

Agent deployment on origin server

No. The agent is a public cloud service from Alibaba Cloud, so no cloud deployment is needed. You can build and use agents by configuring them in the console and calling the OpenAPI.

Connect agent to LLM on Model Studio

The agent is integrated with Alibaba Cloud Model Studio by design. You can call the large language models on Alibaba Cloud Model Studio by simply specifying the required parameters in the console. For more information, see Large Language Models (LLMs).

Integration

Errors occur when starting a call

Error 1: "Could not resolve placeholder..."

This error occurs when a configuration is missing from or deleted in the server-side application.yaml file. The configuration file must contain any variable injected using the @value annotation. You can leave the configuration in the application.yml file with a placeholder value like "xxxxxx", or set it to an empty string "".

Error 2: "User not authorized to operate on the specified resource"

When you deploy the application server, verify that the configured AccessKey is correct and grant the AliyunICEFullAccess permission to the RAM user. For more information, see Deploy from source code.

Error 3: "generateAIAgentCall Tea error. e:code: 404, Specified access key is not found."

Verify that the AccessKey and AccessSecret are configured correctly in the server-side application.yaml file. You must also grant the RAM user the AliyunICEFullAccess permission. For more information, see Deploy from source code.

Error 4: "generateAIAgentCall Tea error. e:code: 400, The specified agentId "123456" is not found. request id: xxxxxxx"

Verify that the agentId and region are configured correctly.

On the Intelligent Media Services console, go to Real-time Conversational AI > Agent Management in the left-side navigation pane. Confirm that the region selected at the top of the page matches the region configured in your code, and then get the correct agentId from the Agent ID/Name column in the agent list.

Error 5: A token is returned, but the client still cannot connect.

Use the RTC token verification tool to verify that the signature was generated correctly. All required parameters are in the server-side request or response. Set nonce to null and check whether the generated token is correct.

"AgentNotFound" error when starting messaging

In your client code, verify that the agentId and region are configured correctly.

On the Intelligent Media Services console, go to Real-time Conversational AI > Agent Management in the left-side navigation pane. Confirm that the region selected at the top of the page matches the region configured in your code, and then get the correct agentId from the Agent ID/Name column in the agent list.

Client code:

Android
String mAgentId = "XXX";          // Agent ID. Use the ID of the messaging conversation agent created on the console.
String mRegion = "cn-shanghai";   // The region where the agent is located. Use the region of the messaging conversation agent displayed on the console.
ARTCAIChatAgentInfo agentInfo = new ARTCAIChatEngine.ARTCAIChatAgentInfo(mAgentId, mRegion)

iOS

// Agent ID. Use the ID of the messaging conversation agent created on the console.
let agentInfo = ARTCAIChatAgentInfo(agentId: "xxxx")
// The region where the agent is located. Use the region of the messaging conversation agent displayed on the console.
agentInfo.region = "cn-shanghai"

"UnsupportedWorkflowType" error when starting messaging

If the error details are "The specified workflowType \"VoiceChat\" is not supported by this interface. Please use a compatible workflowType: [\"MessageChat\"]", check the agentId and verify that its associated workflow type is MessageChat.

On the Agent Management page, find the target agent and check the Agent Workflow ID column to confirm that the associated workflow type is MessageChat.

Adjust client audio capture sample rate

Real-time Conversational AI supports the following settings for client-side audio capture:

  • 48 kHz sample rate, mono channel

  • 16 kHz sample rate, mono channel

By default, the AICallKit SDK uses a 48 kHz sample rate. To switch to 16 kHz, see the following code examples:

Note

The Web SDK supports only a 48 kHz sample rate.

iOS
self.engine.audioConfig = ARTCAICallAudioConfig(audioProfile: .BasicQualityMode, audioScenario: .MusicMode)
// Call other APIs
...  
// Initiate a call
self.engine.call(...)
Android
ARTCAICallEngine.ARTCAICallConfig artcaiCallConfig = new ARTCAICallEngine.ARTCAICallConfig();
artcaiCallConfig.audioConfig.audioProfile = ARTCAICallAudioBasicQualityMode;
engine.init(artcaiCallConfig);

Adjust agent audio playback sample rate

Real-time Conversational AI supports the following audio settings for agent playback:

  • 48 kHz sample rate, mono or stereo channel

  • 16 kHz sample rate, mono channel

By default, Real-time Conversational AI uses a 48 kHz mono channel sample rate. You must adjust this setting in the API call that starts the conversation. The method varies by how you initiate the call:

Method 1: Using the server-side GenerateAIAgentCall API

You can add the AgentConfig parameter and construct the ExperimentalConfig field in AIAgentConfig.

// AudioQualityMode: Integer    
// The sample rate mode for RTC output.
// 0: 48 kHz mono channel 
// 1: 48 kHz stereo channel
// 2: 16 kHz mono channel
// The value of ExperimentalConfig must be a JSON string.
{
    "ExperimentalConfig":"{\"AudioQualityMode\":2}"
}

Method 2: Using the server-side StartAIAgentInstance API

You can add the AgentConfig parameter and construct the ExperimentalConfig field in AIAgentConfig.

// AudioQualityMode: Integer    
// The sample rate mode for RTC output.
// 0: 48 kHz mono channel 
// 1: 48 kHz stereo channel
// 2: 16 kHz mono channel
// The value of ExperimentalConfig must be a JSON string.
{
    "ExperimentalConfig":"{\"AudioQualityMode\":2}"
}

Method 3: Using the client-side call() API

If you create and start a call using the call(xxx) API with the callConfig parameter, you can use this method to modify the agent's playback sample rate.

Note

This method requires AICallKit SDK version 2.5.0 or later.

iOS
let callConfig = ...   // Create and initialize ARTCAICallConfig. For details, see the user guide.
let agentConfig = ARTCAICallAgentConfig()         // Create an ARTCAICallAgentConfig object.
agentConfig.experimentalConfig = [
    "AudioQualityMode": 2
]
...                                                  // Set parameters based on your business requirements.
callConfig.agentConfig = agentConfig
self.engine.call(config: callConfig)                 // Initiate the call.
Android
ARTCAICallEngine.ARTCAICallConfig artcaiCallConfig = new ARTCAICallEngine.ARTCAICallConfig();
artcaiCallConfig.agentConfig.experimentalConfig = new JSONObject();
try {
    artcaiCallConfig.agentConfig.experimentalConfig.put("AudioQualityMode", 2);
} catch (JSONException e) {
    e.printStackTrace();
}
engine.init(artcaiCallConfig);