Package uno.anahata.ai.status


package uno.anahata.ai.status
Provides a robust, event-driven framework for monitoring and broadcasting the real-time operational status of the chat application.

Architecture

This package implements a classic observer pattern to decouple status reporting from the application's core logic, which is essential for building a responsive user interface.
  • StatusManager: The central coordinator and state machine. It tracks the current ChatStatus, manages a list of listeners, and records detailed diagnostic information, including a history of API errors (ApiExceptionRecord) and performance timings.
  • ChatStatus: A core enum that defines the finite set of possible application states (e.g., IDLE_WAITING_FOR_USER, API_CALL_IN_PROGRESS).
  • StatusListener: A simple FunctionalInterface that allows other components (like the UI) to subscribe to status changes.
  • ChatStatusEvent: A rich event object that provides listeners with detailed context about each status transition, including the old and new states and any associated exceptions.
  • Class
    Description
    A record to hold structured information about a single API error event, including retry context.
    Defines the possible operational states of a Chat session.
    An event object that provides rich, contextual information about a change in the Chat's status.
    Listener interface for receiving real-time status updates from a Chat session.
    Manages and broadcasts the operational status of a Chat session.