Introduction
The world of Artificial Intelligence (AI) has become a new trend that everyone is looking at right now, and it has the potential to transform many industries, and Content Management Systems (CMSs) like Drupal is one of them. The fact that we can leverage some of the time-consuming tasks during the content creation process (ALT-text generation, summary teasers, meta descriptions) to AI tools is a promising scenario, and in this article we are going to see some of these AI tools available in the Drupal ecosystem.
What is Drupal?
Drupal is an Open Source Content Management System (CMS) that powers thousands of sites around the world, and has a thriving community of developers who constantly make improvements and create new tools for the CMS, including tools for integrating the existing AI products (ChatGPT, Google Bard, Amazon Lex) into the Drupal ecosystem. You can read more about what Drupal is and how it can help you in the organization in the official site.
What is AI (Artificial Intelligence)?
The term “Artificial Intelligence” refers to the simulation of the human reasoning and/or actions by computers, this includes the so-called machine learning, which is a technique in which machines can learn new information and make better decisions or giving more contextual answers by processing a huge amount of information from the outside (text, image, video).
The idea is to have the machine to mimic human activities like reasoning, learning new things and perception in order to produce answers that only humans give, and do tasks from simple interactions with clients in a chat box, to create custom applications by simply with little or no human intervention.
AI Tools in the market
- ChatGPT: ChatGPT is a natural language processing tool driven by AI technology that allows you to have human-like conversations and much more with the chatbot. The language model can answer questions and assist you with tasks, such as composing emails, essays, and code.
- Google Bard: Bard is Google's experimental, conversational, AI chat service. It is meant to function similarly to ChatGPT, with the biggest difference being that Google's service will pull its information from the web. Like most AI chat bots, Bard can code, answer math problems, and help with your writing needs.
- Midjourney: Midjourney is a well-known text-to-image service which is often used in generating artwork like logs, portraits, screenshots and more.
There’s a bunch of other AI tools/frameworks available in the market, you can find a good list in the AI Tools Directory page.
AI Applications for Drupal
There is a Drupal artificial intelligence (AI) community initiative page for all the ongoing work that is being done for the Drupal - AI integration, this is a good starting point for those who want to rely on external AI tools for assisting in content creation.
Most of the work is being done on integrating Drupal with the existing AI tools in the market, here’s a list of Drupal modules that are being actively developed and tested as I write this article, we’ll look at some of them in detail:
There’s a lot of other Drupal Modules that are in the works and are mostly in alpha state.
In this article we are going to explore a bit more on the OpenAI / ChatGPT Integration module.
OpenAI / ChatGPT Integration
This module has a collection of tools to interact with the OpenAI ecosystem, including ChatGPT and DALL-E, according to the project’s page: “The OpenAI module aims to provide a suite of modules and an API foundation for OpenAI integration in Drupal for generating text content, images, content analysis and more. OpenAI is the company behind artificial generational intelligence products that powers applications like ChatGPT, GPT-4, GPT-3, DALL-E, GitHub CoPilot, and more. Our goal is to find ways of augmenting and adding assistive AI tech leveraging OpenAI API services in Drupal, transforming the way you manage your content and maintenance tasks.”
Installation
You can install the module with composer as usual:
This project comes with a list of submodules that can be installed, for now, we’ll enable OpenAI Core, OpenAI ChatGPT Explorer, OpenAI CKEditor Integration, OpenAI Content Editing Tools, OpenAI Error Log Analyzer, OpenAI DALL-E and OpenAI CKEditor integration:
Create an OpenAI API Key
To use this module, you need an OpenAI API Key to interact with ChatGPT and other AI Tools, you can signup and use the free version or the paid version (which comes with extra goodies).
Once installed, go to /admin/config/openai/settings and provide the OpenAI key you just created and then click on "save".
OpenAI ChatGPT Explorer
You can start by going to /admin/config/openai/chatgpt and interact with ChatGPT from the comfort of your Drupal site!
I can ask questions as I was in the ChatGPT page:
OpenAI CKEditor5 button
Now, what we really want is to use ChatGPT to help us in our content creation process, start by going to Configuration > Text formats and editors, then configure the Text Editor Profile of your choice, and add the OpenAI button to the “Active Toolbar” list:
You should see the OpenAI button in your CkEditor 5:
You can create text, create a summary, or change the tone, all from the comfort of your CkEditor 5.
I believe that some options are disabled if you have a free version of ChatGPT, I’ll double check on that!
OpenAI Content Editing Tools
You can also install the module OpenAI Content Editing Tools and you’ll have some extra editing tools (Summarize text, Suggest content title, Analyze text) when creating/editing your nodes:
I can instruct ChatGPT to suggest a content title based on the content that I have in the Body field:
Or instruct ChatGPT to create a summary of the content in Body:
OpenAI DALL-E
Lastly, one of the coolest tools that you should look into is OpenAI DALL·E, this tool interacts with the OpenAI DALL·E (image generation) endpoint and creates an image based on a desired description, once you install the module, go to /admin/config/openai/dalle and insert a description of the image you want:
Summary
The OpenAI Integration module is one of many modules available for Drupal integration with external AI Tools, there are other modules that are worth looking into, the Drupal artificial intelligence (AI) community initiative is a good starting point for that.
There’s a lot of potential for AI work in Drupal, there’s even a Drupal Machine Learning API (sadly, no longer maintained), but if you have some good developer skills and want to contribute heavily in the Drupal ecosystem, you should look into Artificial Intelligence and how to apply within the Drupal context.
We do Drupal development
Go to our Drupal page!