Skip to content

webchat

diapason.channels.webchat

WebChatChannel — in-memory message queue for webchat/testing.

WebChatChannel

Bases: BaseChannel

In-memory webchat channel for testing and embedded web UIs.

Messages are stored in an internal list and can be retrieved via :meth:get_messages. No external dependencies are required.

Parameters

bus: Optional event bus for publishing channel events.

clear_messages()

Clear all messages from the in-memory queue.

connect()

Mark as connected (always succeeds for in-memory channel).

disconnect()

Mark as disconnected.

get_messages()

Return all messages stored in the in-memory queue.

list_channels()

Return available channel identifiers.

on_message(handler)

Register a callback for incoming messages.

send(channel, content, *, conversation_id='', metadata=None)

Append a message to the in-memory queue.

status()

Return the current connection status.