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.
Parameter | Type | Required | Description |
---|---|---|---|
AgentInstanceId | String | Yes | The unique identifier of the AI agent instance, obtained through the response parameter of the Create An AI Agent Instance interface. |
Text | String | Yes | The text content sent to the LLM service. |
SystemPrompt | String | No | Whether 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:
Untitledhttps://aigc-aiagent-api.zegotech.cn?Action=SendAgentInstanceLLM &<Common Request Parameters>
1 -
Request body:
Untitled{ "AgentInstanceId": "1907755175297171456", "Text": "How is the weather like today?" }
1
Response Parameters
Parameter | Type | Description |
---|---|---|
Code | Number | 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. |
Sample Response
Untitled
{
"Code": 0,
"Message": "Succeed",
"RequestId": "1843985617336143872"
}
1