logo
On this page

SendAgentInstanceTTS

POST

https://aigc-aiagent-api.zegotech.cn/

This interface can be used to actively call the TTS service to send voice messages as the identity of the AI agent. (1. When this interface is called, if the AI agent in the conversation is speaking, the speaking process of the AI agent will be interrupted; 2. The text message passed in through this interface will be recorded in the conversation message history according to the AddHistory parameter, as input to the LLM, and the message will also be sent through the RTC room message.)

Request

Query Parameters

    Action stringrequired

    Possible values: [SendAgentInstanceTTS]

    API Prototype Parameter

    https://aigc-aiagent-api.zegotech.cn?Action=SendAgentInstanceTTS

    AppId uint32required

    The unique Application ID assigned to your project by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.

    SignatureNonce stringrequired

    Random string.

    Timestamp int64required

    Unix timestamp, in seconds. The maximum allowed error is 10 minutes.

    Signature stringrequired

    Signature, used to verify the legitimacy of the request. Refer to Signing the requests for how to generate an API request signature.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Signature version number, default value is 2.0.

Body

required
    AgentInstanceId stringrequired

    The unique identifier of the AI agent instance, obtained through the response parameters of the Create AI Agent Instance interface.

    Text stringrequired

    Possible values: <= 300 characters

    The text content used for TTS, with a maximum of 300 characters.

    AddHistory boolean

    Default value: true

    Whether to record the text message in the conversation message history as input to the LLM.

    InterruptMode integer

    Default value: 0

    The mode of interruption when the AI agent is speaking:

    • 0: Interrupt immediately. If the user speaks while the AI is speaking, the AI will be immediately interrupted and stop speaking (default).
    • 1: Do not interrupt. If the user speaks while the AI is speaking, the AI will not be affected until the content is finished.

Responses

Success
Schema
    Code integer

    Return code. 0 indicates success, other values indicate failure. For more information on error codes and response handling recommendations, please refer to Return Codes.

    Message string

    Explanation of the request result

    RequestId string

    Request ID

curl -L -X POST 'https://aigc-aiagent-api.zegotech.cn/' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
1
Copied!
Request
Collapse all
Base URL
https://aigc-aiagent-api.zegotech.cn
Unified access address (no regional distinction)
Parameters
queryrequired
queryrequired
queryrequired
queryrequired
queryrequired
queryrequired
Bodyrequired
{
"AgentInstanceId": "1907755175297171456",
"Text": "Dear developer, welcome to ZEGOCLOUD RTC to build a real-time interactive world.",
"AddHistory": true,
"InterruptMode": 0
}
RESPONSEClear

Click the "Send" button above and see the response here!

Previous

Trigger LLM

Next

Query The Status of An AI Agent Instance

On this page

Back to top