xb_ai_assistant
No security coverage
Note: The functionality of this module has moved to Drupal Canvas AI
This module provides an AI powered extension to the Experience Builder, enabling users to generate page templates using natural language. Simply describe the desired layout in plain English, such as:
"Create a homepage template for a university website."
"Add a slider with five slides as the second component."
"Display two paragraphs side by side."
The AI assistant will intelligently analyze the available Single Directory Components (SDCs) in your theme/module and strategically assemble them into a well-structured layout.
Watch the demo
Usage
- Provide meaningful descriptions for SDC components: The assistant relies on component and slot descriptions to determine their suitability for a layout. Well defined descriptions improve the accuracy of the generated structure.
- Update settings.php: This module leverages the AI Assiatants and AI agents modules, but requires some tweaks to the default prompts. So add the following lines to the settings.php to override the default prompts
$settings['ai_assistant_advanced_mode_enabled'] = TRUE;
$settings['ai_assistant_custom_prompts'] = TRUE;
- Enable installing test modules: As of now, Some modules from experience_builder/tests/modules must be enabled to use the extension feature. So add the following line also to the settings.php
$settings['extension_discovery_scan_tests'] = TRUE;
ddev drush en experience_builder xb_dev_standard xb_dev_mode
- Setup any AI provider: (e.g: https://www.drupal.org/project/ai_provider_openai, https://www.drupal.org/project/gemini_provider etc.)
- For Gemini provider, the steps to configure can be found in https://www.drupal.org/project/xb_ai_assistant/issues/3525419#comment-16116833
- Install the module.
- Open the Experience Builder UI.
- Click on Extensions and select XB AI Assistant.
Demo with Starshot Demo Design System (SDDS)
- Install the Starshot Demo Design System theme with Experience Builder by following the official guide: https://www.drupal.org/community-initiatives/starshot-demo-design-system...
- Download the module
- Apply the patch from `patches/sdds-sdc-info.patch`: This patch adds descriptions to the existing components
cd starshot
patch -d web/themes/contrib/demo_design_system/ -p1 < web/modules/contrib/xb_ai_assistant/patches/sdds-sdc-info.patch- Add the following lines to the settings.php
// To install the required test modules.
$settings['extension_discovery_scan_tests'] = TRUE;
// To override the default prompts
$settings['ai_assistant_advanced_mode_enabled'] = TRUE;
$settings['ai_assistant_custom_prompts'] = TRUE;
// To use only the SDDS components.
$settings['xb_ai_assistant_ignore_xb_sdc'] = TRUE;
- Setup any AI provider: (e.g: https://www.drupal.org/project/ai_provider_openai, https://www.drupal.org/project/gemini_provider etc.)
- Install the module.
- Open the Experience Builder UI.
- Click on Extensions and select XB AI Assistant.