logo
On this page

SendAgentInstanceLLM

POST

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

This interface can be used to, as the user, actively call the LLM service, and based on the response content of the LLM, actively call the TTS service as the AI agent, and send voice messages to the user. (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 information passed into this interface will not be recorded in the conversation history message and will not be sent through the RTC room message. However, the reply generated by the LLM will be recorded in the conversation history message and sent through the RTC room message.)

Request

Query Parameters

    Action stringrequired

    Possible values: [SendAgentInstanceLLM]

    API Prototype Parameter

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

    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

    The text content sent to the LLM service

    SystemPrompt string

    Whether to temporarily modify the system prompt of the AI agent for this conversation, if needed, fill in this field. If left blank, the system prompt of this conversation will not be changed.

    AddQuestionToHistory boolean

    Default value: false

    Whether to add the question to the context

    AddAnswerToHistory boolean

    Default value: false

    Whether to add the answer to the context

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


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": "What's the weather like today?",
"SystemPrompt": "You are a friendly weather assistant",
"AddQuestionToHistory": true,
"AddAnswerToHistory": true
}
RESPONSEClear

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

Previous

Delete Agent Instance

Next

Trigger TTS

On this page

Back to top