Fixed and improved the system prompt of chats started from assistants (#1172)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-06 17:44:58 +01:00
1 parent bbf4dc2231
commit 31862f5ecd
50 files changed
+1112 -107

No files matched your search

@@ -12,6 +12,9 @@ public partial class AssistantJobPostings : AssistantBaseCore<SettingsDialogJobP
protected override string Description => T("Provide some key points about the job you want to post. The AI will then formulate a suggestion that you can finalize.");
// The prompt of this assistant forbids questions, so the chat gets a prompt of its own, which keeps the role and the language:
protected override ChatSystemPromptChoice ChatSystemPrompt => ChatSystemPromptChoice.Custom(this.CreateChatSystemPrompt);
protected override string SystemPrompt =>
$"""
You are an experienced specialist in personnel matters. You write job postings.
@@ -41,6 +44,23 @@ public partial class AssistantJobPostings : AssistantBaseCore<SettingsDialogJobP
You write the job posting in the following language: {this.SystemPromptLanguage()}.
""";
/// <summary>
/// Creates the system prompt of a chat which continues a job posting, for follow-up questions about it.
/// </summary>
private string CreateChatSystemPrompt() =>
$"""
You are an experienced specialist in personnel matters. You write job postings and follow the usual guidelines
in the country of the posting. You ensure that no individuals are discriminated against or excluded by a job
posting. The user had a job posting written: the conversation so far holds the details the user gave and the
job posting. Now you answer the user's follow-up questions about the job posting, e.g., why it asks for a
qualification or how inclusive a wording is, and you revise the job posting when the user asks for it. A revised
version is always the complete job posting, in Markdown, with the structure of the job posting in this
conversation.
You write the job posting in the following language: {this.SystemPromptLanguage()}.
Answer questions in the language the user writes in.
""";
protected override IReadOnlyList<IButtonData> FooterButtons => [];