Stream chunks
Every chunk on the wire is on the allowlist below. The JavaScript and
Python SDKs reject any chunk not on this list as a
ProtocolError.
Request assertions
Both SDKs check the response headers before parsing the first byte. The server asserts:
| Header | Value |
|---|---|
content-type | text/event-stream |
x-vercel-ai-ui-message-stream | v1 |
x-accel-buffering | no |
x-vedika-turn-id | The server-assigned turn id. |
x-vedika-thread-id | The thread id (resume only). |
The chunk allowlist
Reading the stream
Concatenate every text-delta for a given id. The
id is stable between text-start and
text-end. A turn emits finish, abort,
or error as its terminal chunk. Only one of those three can
arrive on a given turn.
Custom Vedika chunks
Three data-vedika-* chunks carry domain-specific payloads.
Always treat data as an opaque JSON object until the SDK
validates it.
data-vedika-artifact— kundli SVGs, charts, PDF reports.data-vedika-stage— stage progress (image generation, etc.).data-vedika-tool-callanddata-vedika-tool-result— tool dispatch.