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:

Tone of Voice term list

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

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:

Brand tone of voice (source Microsoft)

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?

Issue fork ai-3531643

Command icon 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

leo pitt created an issue. See original summary.

leo pitt’s picture

Issue summary: View changes
annmarysruthy’s picture

Assigned: Unassigned » annmarysruthy

annmarysruthy’s picture

Assigned: annmarysruthy » Unassigned
Status: Active » Needs review

Added 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.

anjaliprasannan’s picture

StatusFileSize
new192.08 KB
new194.3 KB

I 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.

leo pitt’s picture

Also reviewed. Can confirm that the Tone description is now used to generate altered text as expected. Great work.

prashant.c’s picture

Status: Needs review » Needs work

Overall, a great feature to have, working fine. Left a couple of MR comments.

annmarysruthy’s picture

Status: Needs work » Needs review
marcus_johansson’s picture

Status: Needs review » Needs work

This has a merge conflict, could someone take a look? Thanks.

annmarysruthy’s picture

Assigned: Unassigned » annmarysruthy
annmarysruthy’s picture

Assigned: annmarysruthy » Unassigned
Status: Needs work » Needs review

Merge conflict resolved.

marcus_johansson’s picture

Status: Needs review » Needs work

Added some comments that needs to be fixed.

marcus_johansson’s picture

Project: AI (Artificial Intelligence) » AI content
Version: 1.2.x-dev »
Component: AI Content Suggestions » Code