Whatsapp Framework helps you quickly build and deploy whatsapp chatbots in python.
pip install whatsapp-framework
Here's a basic example of how to use Whatsapp Framework:
from datetime import datetime
from whatsapp import Conversation, instruction
class TimeCheckerBot(Conversation):
token = "<whatsapp_admin_token>"
whatsapp_number = "<whatsapp_number>"
system_message = (
"You are helpful conversation assistant for casual chat."
)
@instruction
def check_time(self):
current_time = datetime.now().strftime('%H:%M:%S')
return f"The current time is {current_time}"
def main():
chat_handler = RestaurantAttendantConversation(
debug=True, start_proxy=True,
gemini_model_name="models/gemini-1.5-flash",
)
chat_handler.start(5000)
if __name__ == "__main__":
main()
Whatsapp Framework is licensed under the MIT License. See the LICENSE file for details.
If you have any questions or need support, please open an issue on GitHub Issues or contact us at support@ravenconsulting.site.