Store¶
ConversationStore ¶
Bases: ABC
Persistent storage for rooms, events, bindings, and participants.
Implement this ABC to plug in any storage backend (SQL, Redis, etc.).
The library ships with InMemoryStore for development and testing.
delete_room
abstractmethod
async
¶
Delete a room. Returns True if the room existed.
find_rooms
abstractmethod
async
¶
Find rooms matching the given filters.
find_latest_room
abstractmethod
async
¶
Find the most recent room for a participant.
find_room_id_by_channel
abstractmethod
async
¶
Find a room ID that has a binding for the given channel_id.
list_events
abstractmethod
async
¶
List events in a room with pagination and optional visibility filter.
check_idempotency
abstractmethod
async
¶
Check if an idempotency key has been seen. Returns True if duplicate.
get_event_count
abstractmethod
async
¶
Return the total number of events in a room.
get_binding
abstractmethod
async
¶
Get a channel binding, or None if not attached.
remove_binding
abstractmethod
async
¶
Detach a channel from a room. Returns True if it was attached.
get_participant
abstractmethod
async
¶
Get a participant by ID within a room.
list_participants
abstractmethod
async
¶
List all participants in a room.
resolve_identity
abstractmethod
async
¶
Look up an identity by channel type and address.
link_address
abstractmethod
async
¶
Link a channel address to an identity.
list_tasks
abstractmethod
async
¶
List tasks for a room, optionally filtered by status.
list_observations
abstractmethod
async
¶
List all observations for a room.
mark_read
abstractmethod
async
¶
Mark an event as read for a channel.
mark_all_read
abstractmethod
async
¶
Mark all events as read for a channel.
get_unread_count
abstractmethod
async
¶
Return the number of unread events for a channel in a room.