mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-11 08:47:21 +00:00
Fixed and improved the system prompt of chats started from assistants (#1172)
This commit is contained in:
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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user