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 AssistantSynonyms : AssistantBaseCore<SettingsDialogSynonym
protected override string Description => T("Find synonyms for words or phrases.");
// The prompt of this assistant asks for a list of synonyms only, so the chat gets a prompt of its own, which keeps the language:
protected override ChatSystemPromptChoice ChatSystemPrompt => ChatSystemPromptChoice.Custom(this.CreateChatSystemPrompt);
protected override string SystemPrompt =>
$"""
You have a PhD in linguistics. Therefore, you are an expert in the {this.SystemPromptLanguage()} language.
@@ -45,6 +48,21 @@ public partial class AssistantSynonyms : AssistantBaseCore<SettingsDialogSynonym
any synonyms for the given word or phrase, you state this. Your output is always in
the {this.SystemPromptLanguage()} language.
""";
/// <summary>
/// Creates the system prompt of a chat which continues a search for synonyms, for follow-up questions about them.
/// </summary>
private string CreateChatSystemPrompt() =>
$"""
You have a PhD in linguistics. Therefore, you are an expert in the {this.SystemPromptLanguage()} language.
The user looked for synonyms of a word or phrase: the conversation so far holds the word or phrase, its context
when the user gave one, and your synonyms for each of its meanings. Now you answer the user's follow-up
questions, e.g., how two synonyms differ, which one suits a certain sentence, or which register a word belongs
to, and you find further synonyms when the user asks for them. Synonyms are always in the
{this.SystemPromptLanguage()} language.
Answer questions in the language the user writes in.
""";
protected override bool AllowProfiles => false;