
For your Drupal website, the OpenAI module is a sophisticated solution that supports a wide range of OpenAI/ChatGPT functionalities. It has an API basis for smooth integration and an amazing collection of submodules.
Notably, the module was among the first to use ChatGPT for Drupal, with its initial release being in January 2023. The module is called OpenAI / ChatGPT / AI Search Integration in its entirety. Although it is still in the alpha stage, it is being developed constantly from the best drupal development company. It won’t function on older versions of Drupal because it was made especially for Drupal 10, the most recent major version.
Here are some of the submodules included:

Installation And Basic Setup
Only the submodules that you want to use can be enabled once the OpenAI module has been downloaded to your Drupal 10 website.

Enabling the OpenAI suite’s particular submodules.
Either select “Configure” next to the primary OpenAI module on the Extend page or navigate to Configuration > OpenAI > Settings on your Drupal admin dashboard to begin the setup process. Two fields will appear for which you must enter the following information:

To obtain the API key, sign in to your Open AI account (or register for a new one), choose the “API” section from the user account menu on the top right, and then click “View API keys.”

Click “Create new secret key” and optionally give it a name (e.g., “Testing a Drupal module”) since you will need to establish a new API key. Click “Done” after copying the freshly generated API key to be pasted on the Drupal website.

On the left-hand organization menu, select Settings to obtain the organization’s name or ID.

In general, using the organization ID in settings instead of a name reduces the likelihood of errors. Return to the Drupal site after copying the ID.

On your Drupal site’s OpenAI Settings page, fill up the relevant areas with the organization ID and the API key.

You can now proceed to use specific functionalities given by the modules’ submodules.
With the OpenAi ChatGPT submodule
With the OpenAI ChatGPT submodule enabled you can either click “Configure” next to it on the Extend page or go to the Configuration > OpenAI and open the “ChatGPT explorer” link.

It will take you to a UI for exploring and testing the OpenAI ChatGPT endpoint. All you have to do is enter a prompt in the “Ask ChatGPT” field and wait for the response to appear in the “Response” field.

You don’t absolutely need to alter some of the options on the Options tab; instead, use the appropriate defaults. In any case, knowing what they are is helpful:

We refer to the new CKEditor 5 when we discuss CKEditor integration because, as previously stated, the module is made for Drupal 10. The OpenAI module is one of the most intriguing Drupal modules to expand CKEditor 5 because of its integration.
You must add the OpenAI button to the CKEditor 5 toolbar after turning on the OpenAI CKEditor integration submodule. Simply select “Configure” next to the appropriate format (Full HTML, Restricted HTML, or Basic HTML) under Configuration > Content authoring > Text formats and editors.
Drag the button from the “Available buttons” to the “Active toolbar” once you’re on the settings page for that particular format.

Locate the OpenAI tools plugin by scrolling down to the CKEditor 5 plugin options. Make sure to click the “Enabled” box for the “Text completion” option. The model, temperature, and maximum tokens settings are also visible to you; these are comparable to those we previously discussed in the ChatGPT submodule section.

After a short wait, the specified paragraph explaining how AI operates will show up in the text field.

It is necessary that for other actions, you would have to choose the text first.

Click “Summarize” while the text is selected, and a synopsis of the content will appear.

Clicking “Adjust tone/voice” in the OpenAI dropdown menu after selecting the text will display a balloon panel where you must provide an adjective or descriptive phrase that describes the tone you want. Let’s write “Fairy-tale” in this example and press the green checkmark.

The AI text will eventually change to become genuinely magical.

A balloon window for selecting the language will appear if you pick the text and select “Translate” from the OpenAI dropdown. In this instance, we have typed “Spanish.”

Additionally, the text section is directly translating the enchanted fairy story into Spanish.

Let’s create some nonsense HTML that mimics the anchor link formatting but has clear mistakes in order to test the “Reformat/Correct HTML” choices. The fact that we’re working directly in the text field without accessing the source code is irrelevant.

The artificial intelligence successfully fixes the HTML mistakes and generates a standard anchor link when this line is chosen and the “Reformat/Correct HTML” option is selected.

Additional help choices are listed on the right-hand side of the node editing form in addition to those that are directly in the text editor. The OpenAI Content Tools submodule offers them.
All of Content Tools’ recommendations simply show up in the right-hand panel; no modifications are made to the node text itself, unlike the CKEditor integration submodule. Using an example of an SEO text that was recently AI-generated in CKEditor, let’s explore what you can accomplish.
Click “Suggest taxonomy” and select the field (in this case, the body field) containing the text you like to have in the AI process.

Making use of the “Suggest taxonomy” function.

Soon, taxonomy tags suggested by AI will be displayed.
You can then ask OpenAI to “Suggest content title,” which will need you to choose the title field this time. Artificial intelligence comes up with the text’s title in a matter of seconds.

A synopsis of your text will appear if you click “Summarize” and choose the body field.

You can select the tone from the dropdown menu by selecting “Adjust content tone.” The options include “explain like I’m five,” “professional,” “helpful,” “friendly,” “high school level reader,” and “college level reader.” Choose the field for this action (in this case, body) as normal.

Depending on the chosen tone (in this case, “explain like I’m five”), AI offers the text option. The screenshot below displays OpenAI’s interpretation of what a 5-year-old should comprehend; it may seem a bit implausible, but our purpose is merely to show off the features.
Please take note that developing accessible material requires the use of straightforward language, and the “Adjust content tone” option may be helpful in this respect.

Lastly, the “Analyze text” option verifies that the text complies with different policies. As anticipated, OpenAI confirms that the text is free of any violations when we use it for the body field.

The OpenAI module for Drupal 10 brings powerful AI tools to your workflows. It simplifies tasks like creating content, editing, and analysis. With elements such as CKEditor and ChatGPT integration, improving productivity and user experiences is easy.
At LN Webworks, our experts help you set up and optimize these advanced Drupal features for the best performance. Contact us today to explore AI integration and Drupal development services for your website!