logo
On this page

Trigger LLM


Description

This API can be used to actively trigger the LLM service as a user. Based on the response content from the LLM, the AI agent will use the TTS service to send voice messages to the user.

When this API is called:

  • If the AI agent in the session is speaking, its speech process will be interrupted.
  • The text you send and the LLM's response will be saved in the conversation history.
  • These messages will be used as context for future LLM interactions.
  • The messages will also be sent through RTC room messages.

Request prototype

  • Request method: POST
  • Request body format: JSON
  • Request URL: https://aigc-aiagent-api.zegotech.cn?Action=SendAgentInstanceLLM
  • Transmission protocol: HTTPS
  • QPS limit: 10 times/second

Request Parameters

Listed below are the parameters specific to this request and part of the common request parameters. For the complete list of common request parameters, see Accessing Server APIs - Common request parameters.

ParameterTypeRequiredDescription
AgentInstanceIdStringYesThe unique identifier of the AI agent instance, obtained through the response parameter of the Create An AI Agent Instance interface.
TextStringYesThe text content sent to the LLM service.
SystemPromptStringNoWhether to temporarily modify the system prompt (prompt) for this conversation. If needed, fill in this field. If left blank, the system for this round of conversation will not be modified.

Sample Request

  • Request URL:

    Untitled
    https://aigc-aiagent-api.zegotech.cn?Action=SendAgentInstanceLLM
    &<Common Request Parameters>
    
    1
    Copied!
  • Request body:

    Untitled
    {
        "AgentInstanceId": "1907755175297171456",
        "Text": "How is the weather like today?"
    }
    
    1
    Copied!

Response Parameters

ParameterTypeDescription
CodeNumberReturn code. 0 indicates success, other values indicate failure. For more information on error codes and response handling recommendations, please refer to Return Codes.
MessageStringExplanation of the request result.
RequestIdStringRequest ID.

Sample Response

Untitled
{
    "Code": 0,
    "Message": "Succeed",
    "RequestId": "1843985617336143872"
}
1
Copied!

Previous

Delete Agent Instance

Next

Trigger TTS