Module Description
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-3, 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.

If you would like to partner in this initiative, please contact us. Please note that functionality can change a lot during the alpha/dev releases.

Interested? Join us in the #openai channel in the Drupal Slack: https://www.drupal.org/community/contributor-guide/reference-information....

Updating the module
Some releases update the upstream client dependency. Update the module with Composer with the following to ensure you always get the up to date version:

composer update drupal/openai -W

Included submodules

* openai_api: This is a very simple module that can generate content for you in any content type.
* openai_audio: Adds capability to interact with the OpenAI audio (speech to text) endpoints.
* openai_chatgpt: Enables interaction with the Chat endpoint via ChatGPT API
* openai_ckeditor: Provides a button for CKEditor 5 to send a prompt to OpenAI and get generated text back.
* openai_content: Adds assistive tools for different areas of the content editing process. It adds functionality to adjust the tone of the content, summarize body text, suggest taxonomy terms for nodes, and checks content for Moderation violations.
* openai_devel: Adds GPT content generate capability to Devel Generate. This provides Devel a way of generating realistic content (not lorem ipsum) using GPT and ChatGPT models. Users can generate sample content from the Drupal UI or via Drush. This is useful if you want to fill out your site with realistic sounding content for client demonstration, layout, theming or QA.
* openai_dblog: This module demonstrating log analysis using OpenAI to find potential solutions/explanations for error logs. Responses from OpenAI are saved and will persist for common error messages so you can review them.
* openai_prompt: Adds an area in the admin where you can explore OpenAI text generation capability and ask it (prompt) whatever you'd like.
* openai_embeddings: This module that analyzes nodes and generates vectors and text embeddings of your nodes, taxonomy, media, and paragraph entities from OpenAI. Responses from OpenAI are saved and could augment search, ranking, automatically suggest taxonomy terms for content, and improve search relevancy without expensive search backends. Content personalization and recommendation may also be possible with this approach.

Example: Using the openai_ckeditor module adds a list of actions in CKEditor 5 to run many OpenAI / ChatGPT commands:





Generate text, change and rewrite its tone, summarize text, translate it and more. All right from CKEditor 5. It will even try to fix bad HTML if you ask it to!

Example: Using the openai_chatgpt module to ask ChatGPT for editorial advice:



Example: Using Devel Generate via openai_devel to generate realistic sounding test content from GPT models:

drush devel-generate:content-gpt 5 --base-fields=body,field_foo,field_bar --system="I want to generate content about popular content management systems."



Example: Using the openai_prompt module adds an area in the backend for admins to try out OpenAI text completion / text generation:



Example: Using the openai_content module adds a "Summarize" and "Suggest taxonomy" feature on nodes helping you generate summaries and potential taxonomy terms to categorize the page making a great jumpstart for your content editors:



Suggesting taxonomy:



Example: Putting together keyword search using openai_embeddings module combined with Pinecone to return the most similar/relevant results very fast:



This integration with a vector database can be used to put together a simple content recommendation service without the overhead of Solr/ElasticSearch/Algolia or expensive PAAS. Track the issue #3343800: Document content recommendation approach for more information.

Planned functionality

* Field/field widget integration
* Content moderation
* Views integration
* and more

The development branch contains the latest ongoing work. The OpenAI parent module now implements the https://github.com/openai-php/client client for interacting with OpenAI's API. Since this API client requires PHP 8.1, the dev branch (and future releases) will only work on Drupal 10+.

Releases The alpha tagged release are very usable, but may contain bugs. When features are stabilized and deprecated ones removed we will begin tagging beta releases.

Project Usage
250
Creation Date
Changed Date
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
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.
Data Name
openai

OPENAI CHATBOT

OPENAI CHATBOT

16:29:30
Generic Chatbot
Hi, I'm a Drupal module expert powered by OpenAI, answering your questions about the Drupal module ecosystem. How can I be helpful today? Please note that we will log your question.