Skip to content

Feature: Add Chatbot Readiness Checks and Refine Server Interaction

Alex Rudaev requested to merge bugfix/chatbot_status into main

This pull request enhances the chatbot functionality by adding readiness checks and refining server interactions. These improvements ensure that the chatbot only becomes active when the Rasa server has successfully loaded a model, providing a more reliable user experience.

Key Changes:

  1. Docker Configuration:

    • Simplified Rasa Server URL: Updated docker-compose.yml by removing the /webhooks/rest/webhook endpoint from the RASA_SERVER environment variable. This change streamlines the server URL configuration.
  2. App Enhancements:

    • Chatbot Readiness Check: Modified src/app.py to verify the Rasa server's model readiness before enabling chatbot interactions. This prevents users from interacting with an unavailable chatbot.
    • User Feedback: Added user feedback messages to inform them about the chatbot's availability status and provided instructions for training and loading a model if the chatbot is not ready.
  3. Chatbot Class Improvements:

    • Added is_model_ready() Method: Implemented a new method in the Chatbot class within rasa_chatbot.py that checks the Rasa server's status. This method includes retry logic with exponential backoff to handle scenarios where the server might still be loading the model.
    • Enhanced Error Handling: Improved error handling and logging to provide clearer and more informative messages to users when the chatbot is unavailable.

Summary:

This pull request improves the chatbot feature by ensuring it is only active when a model is properly loaded in the Rasa server. The changes simplify the server URL configuration, add readiness checks with user feedback, and enhance error handling. These updates result in a more dependable and user-friendly chatbot experience.

Merge request reports

Loading