Skip to content

Instantly share code, notes, and snippets.

@KrishGaur1354
Last active February 18, 2025 18:16
Show Gist options
  • Select an option

  • Save KrishGaur1354/8671ea3e87b4a7a7c7a7ecdd16c2f6ce to your computer and use it in GitHub Desktop.

Select an option

Save KrishGaur1354/8671ea3e87b4a7a7c7a7ecdd16c2f6ce to your computer and use it in GitHub Desktop.
Google Summer of Code 2024 - Drupal Chatbot Module

Google Summer of Code 2024 - Drupal Chatbot Module

Project Details

Project Overview

The Drupal AI GPTbot module leverages OpenAI's language models to add an intelligent chatbot to your Drupal site. It analyzes user interactions and provides real-time assistance, information retrieval, and interactive experiences for website visitors.

Key features:

  • AI-powered chatbot interface
  • Customizable chatbot appearance
  • User behavior and engagement analytics
  • Insights for improving user experience
  • Easy integration with existing Drupal sites

For a video demonstration of the chatbot, please visit: https://youtu.be/qdr75LVmHtc

Installation

  1. Download and place the module folder in your Drupal installation's modules directory.
  2. Enable the module through the Drupal admin interface (Extend > AI Chatbot).
  3. Configure the module settings at Configuration > AI Chatbot Settings.

Configuration

  1. Obtain an API key from OpenAI.
  2. Enter your API key in the module configuration page.
  3. Customize the chatbot appearance (color, logo, etc).
  4. Enable or disable specific chatbot features as needed.

Key Achievements

During the course of this project, I achieved several significant milestones that enhanced the functionality and user experience of the chatbot module. I successfully set up a robust development environment using DDEV, a Docker-based tool, which streamlined the development process. I integrated speech-to-text functionality, making the chatbot more accessible to a wider range of users. A comprehensive Drupal settings configuration form was developed, allowing administrators to easily customize various aspects of the chatbot. I implemented secure REST API integration with external services, including a system for managing API keys. Additionally, I created a custom Drupal entity type for storing conversation logs, enabling detailed analysis of chatbot interactions. To optimize performance, I implemented a caching mechanism that significantly improved the chatbot's response time, especially during high-traffic periods.

Timeline Highlights

  • May 27: Project start, intro with Drupal
  • June 3-10: Module creation, project setup, architecture planning
  • June 10-24: Coding (OpenAI integration, Frontend chatbot)
  • July 1: Mid-term Evaluation
  • July 8-22: Testing and extending chatbot functionality
  • July 29-Aug 12: Writing unit test cases
  • Aug 26: Project end

Challenges Faced

While working on the project I encountered several significant challenges. Mastering Drupal's complex architecture and the Symfony framework required intense study and practice. Balancing active development with thorough documentation and testing proved particularly demanding as a one-person team. Adapting to Drupal's specific unit testing methodologies, especially becoming proficient with PHPUnit and Drupal's testing framework, presented a steep learning curve. Additionally, ensuring module compatibility across multiple Drupal versions while maintaining functionality required careful consideration and implementation.

Current Status

Despite the challenges, I've made substantial progress on the project. The chatbot is now fully operational and compatible with Drupal version 9 and newer releases. I've implemented comprehensive unit testing, covering core functionalities and edge cases, significantly enhancing the chatbot's reliability. I've also completed detailed documentation, including installation guides, usage instructions, and API references, to facilitate easy adoption and integration by future users and developers.

Next Steps

Moving forward, I've identified several exciting areas for further development. These include expanding custom Drupal reporting and analytics capabilities for the chatbot, developing an enhanced visual conversation flow builder with custom entity type storing, integrating Drupal Commerce functionality to enable product search and recommendations, and exploring potential integrations with other popular Drupal modules. These enhancements aim to extend the chatbot's capabilities and provide more comprehensive assistance to users within the Drupal ecosystem.

Reflections

My GSoC experience has been truly transformative, significantly enhancing my skills in open-source contribution, Drupal development, and AI integration. The support from the Drupal community and my mentor has been invaluable, allowing me to gain deep insights into Drupal's architecture and module development process while improving my problem-solving skills by tackling real-world challenges in a complex ecosystem. I've developed a stronger understanding of AI integration in web applications, particularly in the context of chatbots, and learned the importance of thorough testing and documentation in open-source projects. I'm excited to continue my involvement with the Drupal community and further refine the chatbot module based on user feedback and emerging AI technologies.

Links to Medium Articles

Link to Resources I looked into:

@mahmoodalisha
Copy link

Hi Krish, I am too looking forward to contributing to Gsoc 25 can you help me with it ? I am a bit confused with the project and how to start, have sent you a request on linked in, kindly connect, I would be grateful to your help

@KrishGaur1354
Copy link
Author

sure, will get in contact with you :)

@lra8dev
Copy link

lra8dev commented Feb 18, 2025

hey @mahmoodalisha, I’m also excited to contribute to GSoC 2025! Let’s connect and support each other on this journey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment