Retrieve agent history
Retrieve agent history
https://api.agora.io/api/conversational-ai-agent/v2/projects/{appid}/agents/{agentId}/history
Call this endpoint while the agent is running to retrieve the conversation history between the user and the Conversational AI agent.
You can set the maximum number of cached entries using the llm.max_history
parameter when calling Start a conversational AI agent. The default value is 32
.
Request
Path parameters
The App ID of the project.
The agent instance ID you obtained after successfully calling join
to Start a conversational AI agent.
Response
-
If the returned status code is
200
, the request was successful. The response body contains the result of the request.OK
- agent_id string
Unique identifier of the agent.
- start_ts integer
Agent creation timestamp.
- status string
Possible values:
RUNNING
Agent status. Only supports querying the running agent.
- contents array
Agent history.
- role string
Possible values:
user
,assistant
The message sender.
user
: Userassistant
: AI agent
- content string
Message content.
-
If the returned status code is not
200
, the request failed. The response body includes the error code and description. Refer to status codes to understand the possible reasons for failure.