Move System Prompt into ChatInput
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3535820. --> Reported by: [marcus_johansson](https://www.drupal.org/user/385947) Related to !780 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The current architecture for system prompts is a little bit confusing. Because we thought of LLM as AI at the beginning, the system prompt is part of the AiProviderclientBase abstract for all providers, rather then being part of the ChatInput where it belongs.</p> <p>There exists a setChatSystemRole and getChatSystemRole on the base class that should stay there until 2.0.0, but we can already start moving it to ChatInput, to make logging and event handling easier.</p> <p>The providers will have too look at both places until 2.0.0.</p> <p>Also it is refered to as system prompt, not system role anymore.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Add a getSystemPrompt and setSystemPrompt to the ChatInput.<br> Add a variable that keeps it in memory.<br> Since we have the ProviderProxy reflection class, we can there move the global system prompt if someone set it, into the ChatInput.<br> Change all submodules to set and get the system prompt from the ChatInput.</p>
issue