Problem/Motivation
ai_content_suggestions now allows an administrator to define a vocabulary as the source for "Tone of voice" options. The terms in that vocabulary are then offered to the content editor as options they can choose from to control the tone of voice used to generate amended copy.
For example, the following list of terms:

Provide the following options in the "Alter tone" dropdown:

However, at present, I believe that only the title of the term is passed to the LLM. In practice, I am likely to want to provide more in-depth guidelines than is allowed by only a title.
For example, if I create a term such as:

Only the words "Brand tone of voice" will be used in the final prompt, e.g. Change the tone of the following text to be Brand tone of voice using the same language as the following text:\r\n
And not the entire Term content, which is what I think most people would expect, and more useful for real-World contexts.
E.g. I would expect to have several tone of voice terms:
- General brand tone of voice
- B2C Appeal page
- B2B Appeal page
With the detailed instructions in the term description.
Steps to reproduce
Install AI Content Suggestions module, configure to use custom taxonomy, add some terms. Note that only the title is used to assist the LLM in generating suggestions.
Proposed resolution
In the prompt: Change the tone of the following text to be {{ tone }} using the same language as the following text:
Should {{ tone }} contain both the term name and description?
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | afterchanges.png | 194.3 KB | anjaliprasannan |
| #6 | before chanegs.png | 192.08 KB | anjaliprasannan |
| Screenshot 2025-06-22 at 15.12.31.png | 353.5 KB | leo pitt | |
| Screenshot 2025-06-22 at 15.04.22.png | 145.96 KB | leo pitt | |
| Screenshot 2025-06-22 at 15.04.33.png | 153.93 KB | leo pitt |
Issue fork ai-3531643
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
leo pitt commentedComment #3
annmarysruthy commentedComment #5
annmarysruthy commentedAdded configurable option to include taxonomy term descriptions in tone prompts. Added "Use term description for tone description" checkbox in settings form (only available when "Choose own vocabulary for tone of voice options" is enabled) - when checked, the AI prompt includes both the term name and description providing more detailed tone guidance to the LLM.
Kindly review.
Comment #6
anjaliprasannan commentedI have reviewed the branch.
Steps followed:
Add a new vocabulary, with terms Brand voice and description Speak like in conference.
Enabled Alter tone in content suggestion and checked in content edit.
Attached the ss after and before fix.
Comment #7
leo pitt commentedAlso reviewed. Can confirm that the Tone description is now used to generate altered text as expected. Great work.
Comment #8
prashant.cOverall, a great feature to have, working fine. Left a couple of MR comments.
Comment #9
annmarysruthy commentedComment #10
marcus_johansson commentedThis has a merge conflict, could someone take a look? Thanks.
Comment #11
annmarysruthy commentedComment #12
annmarysruthy commentedMerge conflict resolved.
Comment #13
marcus_johansson commentedAdded some comments that needs to be fixed.
Comment #14
marcus_johansson commented