vectorbross / vb_ai_summary
Adds an AI button to generate the summary on content types that have a summary field.
Package info
bitbucket.org/vectorbross/vb_ai_summary
Type:drupal-recipe
pkg:composer/vectorbross/vb_ai_summary
Requires
- drupal/ai: ^1.5
- drupal/core: ^11.4
- drupal/field_widget_actions: ^1.5
- drupal/maxlength: ^3.2
- vectorbross/vb_ai_core: ^1.0
- vectorbross/vb_ai_widget_actions: ^1.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-12-03 21:57:21 UTC
README
Adds AI generated summaries on top of
vb_ai_core.
Webmasters and administrators get a Generate summary button under the
summary field (see Permissions).
The field is filled with a short teaser based on the page content, which
they can edit before saving.
The button is only added to content types that have field_summary.
Content types without it are left alone.
What it installs
| Module | Purpose |
|---|---|
field_widget_actions | Shows the generate button under the field |
ai_automators | Runs the prompt (part of drupal/ai) |
maxlength | Character counter under the field |
vb_ai_widget_actions | Config action that adds the button only where the field exists |
It also applies vb_ai_core (ai, key, token) first.
What it configures
Button per content type
| Field on the content type | Button | Counter |
|---|---|---|
field_summary | Generate summary | 250 chars |
A content type gets the button when:
- it has a field with exactly the machine name
field_summary; - the field is a Text (plain), Text (plain, long), Text (formatted) or Text (formatted, long) field;
- the field is visible on the default form display with a normal text field or text area widget.
In every other case the content type is skipped. Fields skipped because of
an unsupported type or widget are logged in the vb_ai_widget_actions
channel in Recent log messages.
The summary that is part of a Text (formatted, long, with summary) field, such as the summary of the core
bodyfield, is not supported. Use a separatefield_summaryfield.
For each content type with field_summary, the recipe creates an AI
Automator (node.<type>.field_summary.default) and adds the button and
the counter to the form display. The automator only runs when the button
is clicked, never on save.
What the AI reads
The AI gets the first of these fields that exists on the content type:
body, field_body. If neither exists, it gets the node title.
It reads the values in the form, so unsaved changes are included.
field_intro is not used as page content on purpose: an intro is usually a
summary itself and gives the AI too little to work with.
Prompt
| Setting | Value | Effect |
|---|---|---|
| Language | page language | The summary matches the page content |
| Length | 2–3 sentences, max 250 chars | Fits a teaser and a plain text field (255 chars by default) |
| Content | page facts only | What the page is about and why it is useful, nothing invented |
| Format | plain text | No title, list, markdown, HTML, quotes or emoji |
| Counter | soft limit | Warns when the text is too long, does not block saving |
ai_provider | default | The default chat provider and model are used |
Requirements
- Drupal 11.4+
- Drush 13+
- The project setup from
vb_ai_core(composer/installers2.3+, therecipes/{$name}installer path and the VBrepositoriesentry) - A chat capable provider recipe, already required and applied, for example
vb_ai_provider_anthropic. The provider recipe sets the default for thechatoperation, which the button uses. field_summaryon the content types. This recipe does not create it.
Install
Require the recipe. Composer pulls in drupal/ai,
drupal/field_widget_actions, drupal/maxlength, vb_ai_widget_actions
and vb_ai_core as dependencies.
ddev composer require vectorbross/vb_ai_summary
Apply the recipe
Make sure a provider recipe has been applied first (see
Requirements). Run from the project root; Drush runs from
the web docroot, so the path starts with ../recipes.
ddev drush recipe ../recipes/vb_ai_summary
ddev drush cr
Content types added later
Add field_summary to the new content type, then apply the recipe again. It
only adds what is missing: existing buttons, prompts and counters are kept,
also when they were changed for the project.
Permissions
The button is only shown to users with the Use AI generate buttons
permission (from vb_ai_widget_actions). The recipe grants it to the
webmaster role and creates that role if it does not exist yet. The
administrator role already has every permission. Other roles, such as
content editors, do not see the button; grant the permission manually if
another role needs it.
The permission covers every AI Automator button, so it also applies to the
buttons of the other VB AI recipes that use vb_ai_widget_actions.
Verify
ddev drush pm:list --status=enabled --filter=field_widget_actions
ddev drush config:get ai_automators.ai_automator.node.article.field_summary.default rule
Then edit a node of a content type with field_summary, fill in the body
and click Generate summary under the field. The field is filled by the
default chat provider.
Options
- Change the prompt for one project at Structure → Content types → (type)
→ Manage fields: edit
field_summaryand change the prompt under AI Automator. Re-applying the recipe does not overwrite it. - Change the prompt, counter or context fields for all projects in
recipe.yml(addAiGenerateButton). This only affects content types that did not get a button yet. - When
field_summaryis a long text field and a longer summary is wanted, raisemax_lengthand the length rule in the prompt together. - To let editors refine the result in a dialog before inserting it, set
enable_refinement: trueinrecipe.yml.
License
GPL-2.0-or-later. See LICENSE.txt.