Top Generative AI Modules to Streamline Content Workflows in Drupal 10
Artificial intelligence (AI) is rapidly transforming various industries, and content creation is no exception. In this blog post, I have explored how AI technologies can streamline content and image creation, improve search results, and even generate code to improve and speed up your content management workflows in Drupal 10.
Top Drupal Modules for AI Text Generation and Augmentation
Text generation in AI has its limitations. While it performs reasonably well on general topics, it may encounter “hallucinations” when asked for specific information. Hallucinations refer to AI’s tendency to make up facts to sound more authoritative. This can lead to ethical considerations, as relying on and passing off AI-generated content as your own may lead to unintended consequences. Additionally, AI’s recency of data is still a limitation, as it might not provide accurate information on recent events.
Despite these limitations, AI text augmentation is a more practical application for Drupal. Instead of having AI create an entire article, it can suggest a title, meta tags, or summarize content. This is particularly useful for Drupal architects who aim to build complex content models with teaser views and filters, but often rely on content creators to tag content and write summaries.
1. OpenAI Module
OpenAI Drupal module is the most popular AI module for Drupal, working specifically with OpenAI and its APIs. It integrates with CKeditor and generate content, modify tones and writing style, and more. It also includes a Content Tool Submit module for various manipulations. While it requires Drupal 9 or higher, it’s easy to set up and use.
OpenAI is known for its ease of setup and versatility with various sub-modules. It offers capabilities like DALL-E for image generation and backend queries, making it a comprehensive tool to explore different AI functionalities. The maintainers are proactive in updating the module to align with new AI advancements, ensuring users have access to the latest features.
2. Augmentor AI Module
Augmentor AI module works with multiple large language models, making it a versatile option. It allows you to define “augmenters” as configuration entities, which become part of your site configuration. This module also works with Drupal 8 and higher, making it accessible for those who haven’t yet migrated to Drupal 10.
Augmentor AI is highly configurable, supporting multiple large language models. It excels in prompt engineering, making it simple for content creators to achieve sophisticated results effortlessly. This module empowers users to tailor AI outputs to their specific needs, enhancing the content creation process.
How to Configure ‘Augmentors’ in the Augmentor AI Drupal Module
When configuring augmenters, you can build prompts as a site builder, allowing content authors to focus on content creation without requiring technical knowledge. For instance, you can structure a prompt to provide five different title suggestions, which will then be parsed and displayed in a dropdown widget.
Augmentors can be configured like content fields, which you can assign to different content types. To configure an augmentor, navigate to Content Types > Article > Manage Fields. Here, you can define the augmentor’s behavior, such as where to extract text from and where to place the output. You can also choose which augmenter to use for a particular widget and customize the label.
Regarding engine selection, you can choose which large language model to connect with during the augmentor configuration process. Then, in the widget configuration, you can select the desired augmentor to connect to the chosen large language model. To understand which large language models each augmentor supports, check the services page. Each augmentor lists the type of large language model it is connected to. If a desired engine is not supported, you can develop a separate module to connect it.
Top Drupal Modules for AI Image Generation: Midjourney, Dall-E, and Stable Diffusion
When it comes to AI image generation, three large language models stand out: Midjourney, Dall-E (a service by OpenAI), and Stable Diffusion. Here’s a comparison to help you understand their differences and use cases.
Midjourney
Midjourney might produce the most aesthetically pleasing images, even without sophisticated prompts. Midjourney offers a free tier with a limited number of credits, after which you’ll need to pay for ongoing use. Access is currently only through Discord, with no direct API, but this may change soon.
Stable Diffusion
Stable Diffusion offers consistent performance and fewer errors. Stable Diffusion is open-source, available on websites like DreamSource by Hugging Face, or for local download and use in Python.
Dall-E
Dall-E excels in semantic interpretation and interpolation judgments, ensuring accurate image generation. Dall-E is part of a paid OpenAI plan, starting at around $10 per month, which includes chatGPT and other services, with API access.
Prompt Engineering Plays a Crucial Role in AI Image Generation
Being descriptive about your desired output is essential. However, leaving prompts more open-ended can sometimes yield surprising results. You can also specify resolution, style or artist emulation, tone, and lighting considerations. Photo-graphic equivalents like focal length, depth of focus, and film style can further enhance your image generation.
By adjusting prompts and exploring different styles, we can witness the diverse outputs these tools can produce. Starting with a simple prompt like “zebra in a sombrero hat,” we can see the straightforward results generated by the Dall-E model. However, by refining our prompt to include a specific style, such as “in a studio-like style,” we introduce a new dimension to the image creation process. Providing additional information about the desired style can significantly impact the output, showcasing the versatility of these AI models.
Midjourney’s showcase
Midjourney’s showcase is an excellent resource for understanding prompt usage. By examining the prompts that generated specific images, you can learn how to structure your prompts effectively.
Chaining technique for generating better prompts
Combining different AI models can lead to even more sophisticated results. For instance, using chatGPT to generate Midjourney prompts can improve output with minimal effort. With the rise of specialized chatGPT models, this “chaining” technique will likely become more prevalent and sophisticated, enabling AI models to handle increasingly complex tasks independently.
How these image generation modules can improve the content marketing workflows in Drupal 10
In Drupal, OpenAI’s Dall-E submodule and OpenAI Images for AI image generation allow us to save generated images to ‘image library’.
After saving the generated images to our media library, we can seamlessly integrate them into articles or any other content. Moving on to the OpenAI Dall-E submodule, we encounter a more robust set of options for image customization. From selecting the Dall-E model and adjusting quality, size, to exploring style controls, this submodule offers a comprehensive approach to image generation.
Upon saving the settings, instead of an immediate preview, the Dall-E submodule provides a link to access the high-resolution version of the image. This feature allows for further exploration and utilization of the generated content. The difference in presentation between Dall-E and OpenAI Dall-E showcases how two tools, utilizing the same AI API, can yield distinct and intriguing results.
By experimenting with prompts, styles, and customization options, we can unlock the full potential of AI image generation tools like Dall-E and OpenAI Dall-E. These tools offer a glimpse into the creative possibilities enabled by AI technology, providing a platform for innovative and visually captivating content creation.
Top Drupal Modules for Code Generation: ChatGPT and Drupal Droid
Developing code, even for Drupal websites, can be simplified with AI models.
ChatGPT
ChatGPT can generate code, although its knowledge might be limited by the recency of Drupal in its core model.
Drupal Droid
The Drupal Droid by Michael Miles is a specialized module for code generation and enhancement. When prompted to create an up hook, the Drupal Droid asked a clarifying question to ensure it understood the request. After validation, it generated code, provided an explanation of its actions, and offered suggestions for structuring the overall module, including class implementations.
These AI tools are particularly beneficial for those transitioning to Drupal or seeking to understand complex implementations. By easing the learning curve and providing clear, actionable insights, AI models can significantly enhance the development experience.
Leveraging these AI modules can streamline Drupal code development, offering valuable support for those learning the platform or tackling complex tasks. By harnessing the power of AI, developers can create more efficient, well-structured codes and scripts within Drupal 10 with greater ease and confidence.
Vector Search: A New AI Technology To Improve The Quality of Search Results in Drupal Websites
Vector search is a promising technology that can significantly improve the quality and speed of search results within websites like Drupal. By vectorizing concepts in text and other media, vector search can deliver more relevant results and execute faster than traditional keyword-matching methods.
Vector search works by converting information into numerical representations that capture meaning across various matrices. This process allows for deeper, more nuanced matching, providing more accurate and contextually relevant results.
Consider a municipal website with years of council meeting notes. With vector search, a user could prompt the system to generate a bulleted list of meetings a specific councilor did not attend in mere seconds. This capability goes beyond simple keyword matching, offering a more sophisticated and analytical approach to search queries.
Vectorization involves plotting concepts in multiple dimensions and connecting them through vectors. For example, by subtracting “man” and adding “woman” to the concept of “king,” we can flip the gender, demonstrating the power of vectorization in achieving a deeper understanding of concepts.
Drupal integrations for vector search include various Search API modules that connect to third-party services like Pinecone and OpenAI Embeddings. The Search API AI module works with Pinecone and OpenAI, while the Search API Solr NLP module offers a less sophisticated natural language processing solution for Solr.
FAQs about Using AI in Drupal
How can I ensure that AI-generated content is legally compliant?
AI-generated content may not be eligible for copyright protection in the United States, as it is not created by a human. It is essential to be aware of the legal implications and consider using paid plans for image services to avoid potential issues.
What is the current understanding of the legalities surrounding AI-generated content?
The legal implications of using AI-generated content are still being determined. While some services claim that using a paid plan grants copyright, the United States Copyright Office does not recognize copyright for AI-generated content, as it is not created by a human.
Can AI be used to write Drupal documentation?
While there are no existing initiatives to auto generate Drupal documentation, the Drupal Droid module demonstrates the potential for AI to explain code, which could be explored as an avenue for documentation generation.
Can AI generate layouts using Drupal’s Layout Builder?
There is no Drupal-specific initiative or tool for AI to build layouts using Layout Builder. However, third-party services exist that can generate layouts for scaffolding websites, and AI can be used to create the overall structure of a website, which can then be imported into a tool that generates AI-based layouts.
What are the best practices for using AI-generated images?
When providing a client with AI-generated imagery, it is crucial to inform them that the images can be used beyond the intended use. This ensures that they are aware of potential copyright issues and the possibility of others using the same image.
Do any of the AI tools mentioned allow for providing additional information to improve context?
Yes, tools like Augmentor AI allow you to define prompts and add different things to them, providing a better context for the model to generate results.
How Manmash Consulting Can Help?
We at Manmash Consulting believe the future of Drupal web development is AI-driven, so we have started to incorporate AI technologies into our content and web development workflows. If you are looking to get your website developed in Drupal 10, or want to migrate your Drupal website from older versions to the latest version i.e. 10, you can contact Manzar Mashhood, founder and CEO of Manmash Consulting on Linkedin, or Whatsapp (+923331200550) or by visiting our contact us page and filling out the contact form there.