WEB channel engine for the Axion conversation framework.
ObjConversationWeb implements the WEB conversation channel. Unlike other
engines (Discord, Telegram, WhatsApp) that push messages to an external API,
this engine writes bot replies directly to the data_web_conversation database
table. An interactive report (ObjReportConversation) polls the table via
HTTP and renders the conversation in the browser.
No API credentials or external service accounts are required.
Browser (10 s poll)
↓ RpcConversation / RpcSendmessage (POST /report/{code}/rpc)
ObjReportConversation
↓ SQL read ↑ SQL write (bot reply)
data_web_conversation table
↑ ConversationInterface.transmit_message()
ObjConversationWeb
↑ called by
ObjConversation.read_conversation(..., "WEB")
↑ triggered by
ObjReportConversation.RpcSendmessage()
Engine discovery: ObjConversation.conversation_factory("WEB") scans
factory.conversation/ for any file whose lowercase name contains
objconversationweb.
data_web_conversationDefined in factory.core/ObjConversation.yaml (schema section) and
auto-created by ObjConversation.__init__() via create_tables_from_yaml().
| Column | Type | Notes |
|---|---|---|
Id |
INT AUTO_INC | Primary key |
ConversationCode |
VARCHAR(255) | Matches def_conversation.ConversationCode |
Package |
VARCHAR(255) | Active package |
ContactId |
VARCHAR(255) | Stable session identifier (user GUID) |
ConversationGuid |
VARCHAR(36) | Unique per browser tab / page render |
Senderid |
VARCHAR(255) | 'bot' for engine output; ContactId value for user input |
Timestamp |
DATETIME | Auto-set on insert |
Messagetype |
VARCHAR(50) | TEXT (default); extendable to IMAGE |
Message |
TEXT | Message body, truncated to 4 096 chars |
Index on (ContactId, Timestamp) for efficient polling queries.
ConversationInterfaceInherits ObjConversationEngine.ConversationInterface.
| Method | Description |
|---|---|
_init_client() |
No-op — no credentials required |
transmit_message(message, to_number="") |
Inserts a bot row into data_web_conversation |
display_options(opts) |
Formats numbered options, calls transmit_message, returns (first_key, first_prompt) |
ConversationBrokerInherits ObjConversationEngine.ConversationBroker.
| Method | Description |
|---|---|
handle_receive(conversation_code, package, contact_id, last_stamp) |
Returns rows from data_web_conversation newer than last_stamp |
handle_send(conversation_code, contact_id, conv_guid, senderid, message) |
Inserts user message row then calls ObjConversation.read_conversation(..., "WEB") |
run() |
Logs a message — no polling loop needed |
No entries in config.yaml are required. The engine is activated by adding a
row to def_conversation_detail with Channel = 'WEB'.
def_conversation entry for your conversation code.def_conversation_detail row:INSERT INTO def_conversation_detail
(ConversationCode, Channel, Botname, OnWelcomeMessage, PageLength)
VALUES
('MYBOT', 'WEB', 'MyBot', 'Welcome!', 5);
ObjReportConversation report and embed it in a page with:data_list = [["MYBOT", "user-contact-id"]]