Replays a finished turn as its persisted SSE events, in emission order
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Returns the turn's status plus every event it emitted, in the order it emitted them — so a client that missed the live stream can reconstruct the turn exactly as if it had watched it.
Pairs with Get a turn's status: poll status until the turn settles, then read it here.
Basic Usage
GET /v2/projects/../stream/agent_ask/7/result{
"threadResponseId": 7,
"threadId": 5,
"answerId": "3f1c9a52-7d4e-4b8a-9c61-2e5f0b7a8d13",
"status": "FINISHED",
"events": [
{ "sseEventType": "thinking", "block_id": 1, "content": "The customers table has a customer_state column." },
{ "sseEventType": "thinking_done" },
{ "sseEventType": "tool_call", "block_id": 2, "id": "toolu_01A", "name": "execute_sql", "sql": "SELECT customer_state, COUNT(*) AS customers FROM olist_customers_dataset GROUP BY customer_state ORDER BY customers DESC LIMIT 5" },
{ "sseEventType": "tool_result", "block_id": 3, "id": "toolu_01A", "name": "execute_sql", "columns": ["customer_state", "customers"], "rows": [["SP", 41746], ["RJ", 12852]], "rowCount": 5 },
{ "sseEventType": "answer", "block_id": 4, "content": "São Paulo leads by a wide margin with 41,746 customers." },
{ "sseEventType": "done", "session_id": "9c537507-9cec-46ed-b877-07bfa6322bed", "trace_id": "f218b1f7-4623-4a56-8b66-18d544797b20", "version": 1 }
]
}Each entry is one persisted SSE payload with a sseEventType field naming the frame it came from. The payloads are identical to the live ones — see Event Types for each shape.
To render the answer, concatenate the answer entries that share a block_id, in array order.
Reading it back
const { status, events } = await getResult(threadResponseId);
// The answer, reassembled.
const answer = events
.filter((e) => e.sseEventType === 'answer')
.map((e) => e.content)
.join('');
// Anything the agent produced along the way.
const artifacts = events.filter((e) => e.sseEventType === 'artifact');A turn that failed still has a result — the
errorevent is inevents, andstatusisFAILED.
Answer feedback
Answer feedback is currently available on self-hosted Wren AI. Coming soon to Wren AI Cloud.
The response carries the turn's answerId — the same one the init frame carried. A turn started before this deployment supported feedback has none. Pass it to Submit answer feedback to let your users rate the answer. See Getting an answerId for the rules every feedback-capable endpoint follows.
