Streamed events
AgenticRetrieveStream sends zero or more traceEvent and responseEvent events, then exactly one result or one error event.
-
A
traceEventreports a planning or retrieval step, its status, and a short description for people to read. Use it to show progress. The description is written for people, so display it as is and don’t write code that depends on its wording. -
A
responseEventcarries answer text. Concatenate the chunks in order to rebuildanswer. The answer arrives in one chunk after the agent finishes composing it. Concatenate everyresponseEventanyway, so your code keeps working if the answer arrives in several chunks.
Errors before the stream starts are ordinary HTTP errors; after it starts, a failure arrives as an error event. If the stream fails, retry the whole request.