Real-Time Streaming
Real-time streaming is under active development and is not enabled on accounts yet. Everything on these pages is documented ahead of availability and is subject to change — do not build against it as though it were live.
To show assistant replies today, poll
conversation-state instead. A
run typically settles in 7–11 seconds, so a 2-second poll gives a responsive-enough
experience without Firebase.
Talk to your account team if you want to be told when this ships.
Assistant replies arrive token by token over Firebase Realtime Database, so a client can render text as it is generated instead of waiting for the finished message.
How It Works
During generation, the platform emits token chunks, run lifecycle events, and finalized messages onto internal Kafka topics. A platform component (the Firebase bridge) subscribes to those topics and mirrors each event into RTDB, keyed by conversation. Your client attaches a Firebase listener to the relevant node and receives every write in order.
send-message (POST) ──▶ runId
│
▼
generation runs ──▶ Kafka ──▶ Firebase bridge ──▶ RTDB nodes
│ │
│ client listener ◀─┘ (real-time)
▼
poll conversation-state (alternative, no Firebase)
You authenticate to RTDB with the same Firebase ID token you send as the Authorization: Bearer header on REST calls (see the Mobile App example). Database security rules scope each user to their own conversations.
RTDB Node Layout
All nodes are keyed by the conversation. {conversationId} is the threadId returned by create-thread (the same value you pass as conversation_key).
| Node | Purpose |
|---|---|
streaming/{conversationId}/{messageSequence} | Incremental token chunks for the in-flight assistant message |
streaming/{conversationId}/{messageSequence}/meta | Stream status for that message (streaming → complete/error) |
conversations/{conversationId}/status | Authoritative conversation activity state (busy/idle) |
events/{eventName}/{conversationId}/messages | Finalized messages once a turn settles |
events/{eventName}/{conversationId}/runs | Generation started / completed markers |
{messageSequence} is the sequence number of the assistant message being generated. Read the current sequence from the seq field on the conversations/{conversationId}/status node.
{eventName} is a sanitized event type, e.g. llm_v1_common_v1_conversationmessagepublishedevent for messages.
Where to next
| Page | Covers |
|---|---|
| Payloads | Chunk shape, conversation status, finalized messages |
| Subscribing | A worked client subscription, and when to poll instead |
Related
- Conversations — Threads, messages, and generation
- Generation — Polling
conversation-stateas an alternative - Example: Mobile App — End-to-end client integration and auth