Retrieves chat content from a specific checkpoint by specifying a session ID and an agent ID.
Operation description
Request description
The response is returned as a Server-Sent Events (SSE) stream. Each event follows the
SSEEventpattern and includes metadata about the message level.The
contentfield in each SSE event may contain the actual message text or a JSON object, depending on the value of thecontent_typefield.
Try it now
Test
RAM authorization
Request syntax
POST /api/v1/chat/stream HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DMSUnit |
string |
No |
The DMS unit. For users on the Alibaba Cloud China site, the default value is cn-hangzhou. |
cn-hangzhou |
| SessionId |
string |
No |
The session ID. This parameter is required. |
sess_12345 |
| AgentId |
string |
No |
The agent ID. This parameter is required. |
xxxx-xxxx-xxxx |
| Checkpoint |
string |
No |
The backend returns output starting from this checkpoint. |
0 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Each data object in the SSE response stream conforms to this JSON structure. |
||
| content |
string |
The message content. |
Data understanding completed. |
| event_type |
string |
The type of the message. This is used to distinguish between control characters and specific messages. For example, |
DATA |
| content_type |
string |
The type of the content field. Possible values: [str, json]. When the value is json, the |
str |
| checkpoint |
integer |
The checkpoint value. |
0 |
| level |
integer |
The output level of the message. A higher level indicates greater importance. |
20 |
| category |
string |
The category of the message. This helps parse content in JSON format. For example, ` |
PLAN |
Examples
Success response
JSON format
{
"content": "Data understanding completed.",
"event_type": "DATA",
"content_type": "str",
"checkpoint": 0,
"level": 20,
"category": "PLAN"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.