Utility Endpoints
Get Stream Status
GET
Get Stream Status
TheDocumentation Index
Fetch the complete documentation index at: https://docs.chatzy.ai/llms.txt
Use this file to discover all available pages before exploring further.
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
stream_statusis “is_streaming” butresponse_processing_statusisnull.- Meaning: The message is sent for processing, but no response is being processed yet.
- Action taken:
- API call to the
get_responseendpoint to get the response. - Show message loading state.
- API call to the
Case 2: Stream initialized and processing
-
stream_statusis “is_streaming” andresponse_processing_statusis “processing”. -
Meaning: The response is still being generated. No need to call
get_responseendpoint. -
Action taken:
- Keeps showing the message loading state.
- Poll
/get_stream_statusendpoint untilMAX_TRIESis reached or both (stream_statusandresponse_processing_status) getcompletedwhichever first:- If retries (tries) are less than
MAX_TRIES, increase the counter. - If retries exceed
MAX_TRIES, stop loading and stop polling.
- If retries (tries) are less than
Case 3: Stream is completed
-
Both
stream_statusandresponse_processing_statusare “completed”. - Meaning: The AI Agent has finished generating the response.
-
Action taken:
- Call the
/get_messages_for_conversationendpoint to get the latest messages and show them to the UI.
- Call the
-
After processing:
- Turn off the message loading state
- Clear polling/interval loop
Case 4: Unknown / Other status
- 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.
Get Stream Status