Install
Works with Drupal: ^10.4 || ^11 || ^12Using Composer to manage Drupal site dependencies
Alternative installation files
Download tar.gz
94.72 KB
MD5: dabbc5d25c5225c99c1033eeb4bb7296
SHA-1: f1ebefbf1848daafd3363d7b4dbe5f897a34ccaf
SHA-256: bef37a7937784464889017c5a93e7f48e4d36b500528dddd9a3d2ef914919e08
Download zip
135.35 KB
MD5: 59c9a8463edb97b3008d5e600bf9833f
SHA-1: 8e99816ae97865a87a315da52dacb304dcaba889
SHA-256: 891e68b14de8fb9a4d199e8a43dd20e0fb7531b17232b476fa878cf157641bcb
Release notes
First tagged release of AI Assistant UI. The module adds a chat widget and AI search answers for assistants built with the AI module's assistant framework, with a front end made of Drupal-native Single Directory Components.
This is a beta: the feature set is complete enough to use on real sites, and feedback in the issue queue is welcome before a stable 1.0.0.
Installation
composer require 'drupal/ai_assistant_ui:^1.0@beta' drush en ai_assistant_ui
Requires Drupal 10.4 or later, 11 or 12, and drupal/ai ^1.0 with the AI Assistant API submodule, a configured AI Assistant and an LLM provider. Sites that ran 1.x-dev should run drush updb after updating.
What is in this release
Chatbot block
- Answers can stream in as the model writes them (Server-Sent Events), or arrive complete in one response when streaming is off.
- Server-side conversation history per visitor session, with optional restore after a page reload.
- Markdown in responses rendered as HTML when
league/commonmarkis installed; assistant HTML is filtered against an allowed-tags list either
way. - Suggested first questions, introduction text, disclaimer and configurable labels.
- Optional terms of service screen: consent is stored in the visitor session, enforced on the chat endpoint, and can be revoked from the chat, which clears the
conversation. - In-browser test runner in the block form for trying questions against the assistant.
AI search answers
- Search Results block: reads the query from a URL parameter and shows the assistant's answer on the search page.
- "AI Assistant answer" Views area: answers the view's current search, including exposed filters and facets, and follows Views AJAX.
- Active filters are sent to the assistant in readable form;
hook_ai_assistant_ui_search_context_alter()lets modules adjust them or replace the
message. - Optional per-session answer cache, collapsible answer height and link preview cards.
Security and limits
- The chat endpoint is flood-limited to 120 requests per hour per account or IP address; link previews to 120 per ten minutes per IP address.
- API requests must be same-origin and carry a custom header; request bodies, messages and provider answers are size-limited.
- Link previews are fetched server-side only from this site's own origin or from hosts that resolve exclusively to public addresses.
- Provider errors are logged; visitors only see the assistant's configured public message.
Theming and tooling
drush aut-scaffold chatbot|search-resultscopies a component and its template into a theme as a starting point.drush aut-clear-cacheclears all cached search answers.- Every chat request costs money at the AI provider, and the chat endpoint is reachable by anyone with access content.
- Terms of service are only enforced for chatbot blocks placed through Block layout; a Layout Builder-only placement cannot define them.
- Link previews need PHP's cURL extension.
- The link preview Basic Auth password is stored in the block configuration and is exported with it.