Stream Conversation
const url = 'https://api.uavcrew.ai/v1/chat/conversations/example/stream';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.uavcrew.ai/v1/chat/conversations/example/stream \ --header 'Authorization: Bearer <token>'SSE endpoint for real-time conversation updates.
Connect with EventSource: const es = new EventSource(‘/v1/chat/conversations/{id}/stream’); es.addEventListener(‘message’, (e) => { … }); es.addEventListener(‘typing’, (e) => { … });
Events: - message: New/complete message (authoritative, from DB) - typing: Participant is typing - participant_joined: New participant added - participant_left: Participant removed - read_receipt: Participant marked as read - stream_start: Agent started generating (create empty bubble) data: { participant_id } - stream_chunk: Token batch from agent (append to bubble) data: { participant_id, delta, chunk_index } - stream_error: Agent generation failed (clear partial bubble) data: { participant_id } - tool_call: Agent is invoking an MCP tool data: { participant_id, tool_name } - handoff_announce: Routing handed off to a different AI participant. data: { from_participant_id, to_participant_id, reason, trigger } trigger ∈ { “invite_agent”, “mention”, “default_route” } On a fresh-add invite turn, ordering is: participant_joined → handoff_announce → invitee’s stream_start → stream_chunk* → stream_end → message On an already-present target, participant_joined is skipped.
Streaming flow: stream_start → stream_chunk* → message (final) Clients should replace accumulated stream text with the authoritative message payload when the final ‘message’ event arrives.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”Successful Response
Example generated
exampleValidation Error
object
object
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}