Models and custom classes to work across the Chattyverse
Actively maintained. Last release 3 days ago. A safe choice.
$
pip install letschatty#PUSH
poetry version patch; poetry build; poetry publish
Chatty Analytics
Models and custom classes to work across the Chattyverse.
Lastest update: 2024-11-07
Development instrucions
- Install poetry https://python-poetry.org/docs/
- Run
poetry install - Install with pymongo: poetry install -E db to include pymongo dependencies
Architecture
Models
- Data containers with Pydantic validation
- No business logic
- Little to no functionality (for that, see Services)
- Used for:
- Request/response validation
- Database document mapping
- Cross-service data transfer
- Example:
Messagemodel
Services
- Contain all business logic
- Work with models
- Stateless
- Handle:
- Object creation (factories)
- Model specific functionality
- Example:
MessageFactory- Create a
Messagefrom webhook data - Create a
Messagefrom an agent request to send it to a chat - Instantiate a
Messagefrom data base information - Create a
Messagefrom a Chatty Response
- Create a
Implementation Status
✅ Implemented
Models
- Base message models
- DBMessage: Database message model
- MessageRequest: It models the intent of a message to be sent to a chat, still not instantiated as ChattyMessage.
- BaseMessage (abstract)
- Subtypes: AudioMessage, DocumentMessage, ImageMessage, TextMessage, VideoMessage, etc.
- MetaNotificationJson: Models any notification from WhatsApp to the webhook
- MetaMessageJson: Models the speicifc Notification with a messages object
- MetaStatusJson: Models the specific Notification with a statuses object
- MetaErrorJson: Models the specific Notification with an errors object
- ChattyResponse: Models a list of pre-set responses in Chatty, that will be instantiated as a ChattyMessage when sent to a chat.