Basic AI Assistant Context should be configurable via checkbox and textarea

Created on 3 December 2024, 4 months ago

Problem/Motivation

This first requires this to be merged: https://www.drupal.org/project/ai/issues/3488891 📌 AI Agents reinvent Drupal Active

Some people might be uncofomfortable with the tokens module and writing prompts to have certain basic context given to the assistant, like current path.

We should add a way where some of the tokens are just checkboxes that adds one line of text into the system prompt.

For example the checkbox "Current Path" would add "Current path is: [current_path:token]\n".

On top of that should be a textarea with any custom tokens that should be added. This should be editable by default and have the list of tokens that you can add.

Proposed resolution

Add this for the following:
* Current path
* User name
* Site name
* Page title
* User language

Rewrite the runner to add these rows into a fixed token in the system prompt together with the textarea.

Make an update script that removes the part that is the tokens from the system message and updates this with just the token placeholder.

📌 Task
Status

Active

Version

1.0

Component

AI Assistants API

Created by

🇩🇪Germany marcus_johansson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024