If you enabled stream, whenever a AI message should be streamed, you will receive that kind of JSON response:
{
"messages": [],
"clientSideActions": [
{
"type": "stream",
"stream": true,
"expectsDedicatedReply": true
}
]
}
The bot is ready to accept the message streaming. You now need to send the following query:
curl -X POST https://typebot.co/api/v2/sessions/{sessionId}/streamMessage
This endpoint will send Server-Sent events with all the information to display the streamed message.
Once it is done, you can contine the flow by sending a continue chat request with the streamed message as the message content