Renders events as OpenAI chat.completion.chunk maps for the Gateway's SSE stream.
text_deltabecomesdelta.content.thinking_deltabecomesdelta.reasoning_content.tool_startedandtool_completedbecome short progress lines indelta.reasoning_content, so a client shows tool use without the progress entering the answer text.permission_requestbecomes areasoning_contentline (a Gateway client cannot answer it, soPermissionsfails closed and the tool call is blocked).
Every other event produces no chunk. The first chunk (role) and the closing chunks (stop, usage) belong to the HTTP handler, which knows the usage totals.
Options: :id, :created (Unix seconds), :model.
Summary
Functions
A chunk with an empty delta and a finish_reason, for the handler's closing frame.
The chunk that carries only the assistant role. The handler sends it first.
The usage chunk. It has no choices.
Functions
A chunk with an empty delta and a finish_reason, for the handler's closing frame.
The chunk that carries only the assistant role. The handler sends it first.
The usage chunk. It has no choices.