Core Framework API
loglife.core
Chat interface core package (transports, clients, shared protocols).
Message
dataclass
Normalized representation of transport messages.
Source code in src/loglife/core/messaging.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
from_payload(payload)
classmethod
Construct a message from a raw transport payload.
Source code in src/loglife/core/messaging.py
32 33 34 35 36 37 38 39 40 41 | |
init()
Initialize the core system (DB, Logging, Workers).
Call this at the start of your application.
Source code in src/loglife/core/interface.py
24 25 26 27 28 29 30 31 32 33 | |
recv_msg(block=True, timeout=None)
Receive the next message from the inbound queue.
Blocks until a message is available unless block=False.
Source code in src/loglife/core/interface.py
36 37 38 39 40 41 | |
send_msg(message, to=None)
Send a message to the outbound queue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
Message | str
|
A Message object OR a string text. |
required |
to
|
str | None
|
The phone number to send to (required if message is a string). |
None
|
Source code in src/loglife/core/interface.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |