An answer and its evidence.
Append text fragments in order. Keep tool results available for inspection alongside the completed answer.
Read complete SSE frames, then interpret the event type.
Append text fragments in order. Keep tool results available for inspection alongside the completed answer.
Skip prose generation. Collect the tool results in done.data; the transport is still SSE.
| Event | Payload fields | How to handle it |
|---|---|---|
status | message | Progress update. |
tool_call | tool | A data tool is about to run. |
tool_result | tool, data, duration, is_error | One complete tool-result object. Inspect is_error. |
generating | type | AI prose generation has started. |
text | content | Append to the answer in arrival order. |
suggested_actions | actions | Suggested follow-up questions. |
done | tools_used, usage, message_id; data in data mode | Terminal event. data mode includes the collected { tool, data } results. |
error | detail, code | The stream failed after starting. |
Ignore keepalive comments. Parse the JSON in each data frame. A tool result with is_error: true is a failed tool result, even if the overall request continues. An SSE error event means the request failed after the stream began.
If the connection closes before done, mark the result incomplete. The included Node.js client handles fragmented frames, CRLF line endings, multi-line data and errors. It does not automatically retry a potentially billable request.
# Set GDB_API_KEY securely in your server environment first.
node regis-stream.mjs "Find company VICAT in FR" data