Add a setting that is required to set to override prompts
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3499378. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
Related to !405
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The assistant is dependent on three different components for its system message.</p>
<ul>
<li>The system prompt, which is the parent component that is always running and loading the two texts under and also giving some context like the user role, current path etc.</li>
<li>The pre-action prompt which are instructions on the tools/agents/RAG/plugins the assistant can use. The only are available on the pre-action stage.</li>
<li>The instructions, which are extra instructions on top of both this, that should always run.</li>
</ul>
<p>Out of these the system prompt and the pre-action prompt are set to a fairly working default text when you create new assistant and also already today requires you to change a settings value to be able to edit at all. Our estimation is that most people will not touch this at all.</p>
<p>The instructions, together with the tools it can use, are what makes the assistant specific for what it is doing in term of language, formatting, length of answers etc.</p>
<p>The other two prompts are however part of the configuration that useally goes into a recipe, like the AI recipe in Drupal CMS. This means that if we add a fixed version there, we will not be able to change it on the systems that have already installed it. This was never the purpose.</p>
<p>The is rather that people that know how to write prompts, can override also the system prompt and pre-action prompt, while most sites would be ok with having prompts with incremental improvements.</p>
<p>The solution for this would be the same as with the setting for modifying this and basically having a setting for running the overriden pre-action prompt and system prompt. This means that people that are comfortable with changing in settings.php will still have this option.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ul>
<li>Add a settings called ai_assistant_custom_prompts that has to be set to TRUE to run the overriden prompts.</li>
<li>Add a description for this.</li>
<li>Document it on <a href="https://project.pages.drupalcode.org/ai/">https://project.pages.drupalcode.org/ai/</a></li>
<li>Make sure that the pre-action prompt and system prompt that is located in text files, otherwise runs from cache.</li>
</ul>
issue