Lists the API operations of the Web SDK, including engine methods and callback events.
API overview
Earlier SDK versions contain deprecated parameters and methods. We recommend that you upgrade to the latest version. For more information, see Web SDK usage guide.
|
Class/Protocol |
API |
Description |
|
ARTCAICallEngine Defines the engine API operations. |
Starts a call. |
|
|
Hangs up. Note
Call handup to hang up the call before the page exits, for example, by listening for the beforeunload event. If you do not, the agent waits about 90 seconds to exit. This may cause issues such as exceeding the concurrent limit for digital humans. |
||
|
Sets the agent rendering view. |
||
|
Sets the local preview view. |
||
|
Interrupts the agent's speech. |
||
|
Enables or disables smart interruption. |
||
|
Enables or disables camera push. |
||
|
Switches the camera. |
||
|
Switches the voice. |
||
|
Mutes or unmutes the microphone. |
||
|
Stops or resumes the playback of the agent's audio stream. |
||
|
Starts speaking in push-to-talk mode. |
||
|
Finishes speaking in push-to-talk mode. |
||
|
Cancels the current speech in push-to-talk mode. |
||
|
Enables or disables push-to-talk mode. In push-to-talk mode, the agent reports the result only after finishPushToTalk is called. |
||
|
Gets the Alibaba Real-Time Communication (ARTC) engine. |
||
|
Sends a text message to the agent. |
||
|
Sends a custom message to the server. |
||
|
Updates the system prompt of the Large Language Model (LLM). |
||
|
Updates the VCR configuration. |
||
|
Updates the parameters of the Model Studio application. |
||
|
For a visual understanding agent, starts custom frame capture. After this is started, you cannot talk to the agent by voice. |
||
|
For a visual understanding agent, stops custom frame capture. |
||
|
Releases resources. |
||
|
ARTCAICallEngine Engine callback events |
An error occurred. |
|
|
The call started. |
||
|
The call ended. |
||
|
The agent status changed. |
||
|
The volume changed. |
||
|
Reports the agent's recognition result for the user's question. |
||
|
Reports the agent's response. |
||
|
The voice of the current call changed. |
||
|
The push-to-talk mode changed. |
||
|
The current agent is about to leave (end the current call). |
||
|
A custom message was received from the current agent. |
||
|
The voice interruption for the current call was enabled or disabled. |
||
|
A live agent is about to take over from the current agent. |
||
|
The live agent takeover is connected. |
||
|
Fires when the agent message channel becomes available. |
||
|
A VCR result was received from the current agent. |
API details
ARTCAICallEngine details
ARTCAICallEngine event details
agentDataChannelAvailable
Fires when the agent message channel becomes available. After this callback fires, you can start sending messages to the agent.