WhenDocumentation Index
Fetch the complete documentation index at: https://docs.poly.ai/llms.txt
Use this file to discover all available pages before exploring further.
streaming_enabled is true on session creation, agent responses arrive incrementally as EVENT_TYPE_POLY_AGENT_MESSAGE_CHUNK events instead of a single EVENT_TYPE_POLY_AGENT_MESSAGE. This lets you display the response as it’s generated.
Chunk format
| Field | Type | Description |
|---|---|---|
message_id | string | Same across all chunks of one message — use this to group them |
text | string | A fragment of text to append to the message |
attachments | array | Attachment(s) to append to the attachment list |
response_suggestions | array | Suggestion(s) to append to the suggestions list |
chunk_index | integer | 1-based index. Process chunks in this order. |
is_complete | boolean | true on the final chunk — the message is now complete |
Reassembling chunks
To reconstruct the full message, concatenatetext and append attachments / response_suggestions from each chunk in order:
| Chunk | Received | Accumulated message |
|---|---|---|
| 1 | text: "Hello ", attachments: [A1], suggestions: [S1] | text: "Hello ", attachments: [A1], suggestions: [S1] |
| 2 | text: "there, ", attachments: [], suggestions: [] | text: "Hello there, ", attachments: [A1], suggestions: [S1] |
| 3 | text: "how can I help?", is_complete: true | text: "Hello there, how can I help?", attachments: [A1], suggestions: [S1] |
The final chunk (
is_complete: true) may have empty text. It signals that the message is complete and may carry attachments or response suggestions that were only available after the full response was generated.
