Skip to main content
GET
/
get_stream_status
Get Stream Status
curl --request GET \
  --url https://vevdoh3hve.execute-api.us-east-1.amazonaws.com/prod/get_stream_status
{
  "data": {
    "messages": [
      {}
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.chatzy.ai/llms.txt

Use this file to discover all available pages before exploring further.

The get_stream_status API checks the current status of a streaming process (conversation streaming). This is useful for checking if the streaming process is still active and if a response is generated for the latest message in case client disconnects from the stream.

Case 1: Stream not started yet

if (response_processing_status === null && stream_status === 'is_streaming') {
  // code here
}
  • stream_status is “is_streaming” but response_processing_status is null.
  • Meaning: The message is sent for processing, but no response is being processed yet.
  • Action taken:
    • API call to the get_response endpoint to get the response.
    • Show message loading state.

Case 2: Stream initialized and processing

else if (response_processing_status === 'processing' && stream_status === 'is_streaming') {
    // code here
}
  • stream_status is “is_streaming” and response_processing_status is “processing”.
  • Meaning: The response is still being generated. No need to call get_response endpoint.
  • Action taken:
    • Keeps showing the message loading state.
    • Poll /get_stream_status endpoint until MAX_TRIES is reached or both (stream_status and response_processing_status) get completed whichever first:
      • If retries (tries) are less than MAX_TRIES, increase the counter.
      • If retries exceed MAX_TRIES, stop loading and stop polling.

Case 3: Stream is completed

else if (response_processing_status === 'completed' && stream_status === 'completed') {
    // assistant response generation completed
    // code here
}
  • Both stream_status and response_processing_status are “completed”.
  • Meaning: The AI Agent has finished generating the response.
  • Action taken:
    • Call the /get_messages_for_conversation endpoint to get the latest messages and show them to the UI.
  • After processing:
    • Turn off the message loading state
    • Clear polling/interval loop

Case 4: Unknown / Other status

else {
  clearInterval(intervalId);
}
  • Any other situation that doesn’t match the above cases.
  • Meaning: Something unexpected happened or no valid status.
  • Action taken:
    • Stops checking by clearing the interval.

Query Parameters

conversation_id
string
required

Conversation ID for which the stream status is to be checked.

Example:

"96333140-53c3-4d1d-bbd1-edd150d46ea2"

Response

200 - application/json

Stream status and messages

data
object
required