mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-14 22:21:36 +00:00
Refactored default system prompt to use date and time (UTC & local)
This commit is contained in:
parent
9e55d5461f
commit
0b006cd330
@ -99,7 +99,7 @@ public partial class AssistantAgenda : AssistantBaseCore<SettingsDialogAgenda>
|
|||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void ResetForm()
|
protected override void ResetForm()
|
||||||
|
|||||||
@ -120,7 +120,7 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore<SettingsDialo
|
|||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void ResetForm()
|
protected override void ResetForm()
|
||||||
|
|||||||
@ -28,7 +28,7 @@ public partial class AssistantEMail : AssistantBaseCore<SettingsDialogWritingEMa
|
|||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void ResetForm()
|
protected override void ResetForm()
|
||||||
|
|||||||
@ -43,7 +43,7 @@ public partial class AssistantGrammarSpelling : AssistantBaseCore<SettingsDialog
|
|||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void ResetForm()
|
protected override void ResetForm()
|
||||||
|
|||||||
@ -53,7 +53,7 @@ public partial class AssistantJobPostings : AssistantBaseCore<SettingsDialogJobP
|
|||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void ResetForm()
|
protected override void ResetForm()
|
||||||
|
|||||||
@ -30,7 +30,7 @@ public partial class AssistantLegalCheck : AssistantBaseCore<SettingsDialogLegal
|
|||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void ResetForm()
|
protected override void ResetForm()
|
||||||
|
|||||||
@ -33,7 +33,7 @@ public partial class AssistantMyTasks : AssistantBaseCore<SettingsDialogMyTasks>
|
|||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void ResetForm()
|
protected override void ResetForm()
|
||||||
|
|||||||
@ -44,7 +44,7 @@ public partial class AssistantRewriteImprove : AssistantBaseCore<SettingsDialogR
|
|||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void ResetForm()
|
protected override void ResetForm()
|
||||||
|
|||||||
@ -55,7 +55,7 @@ public partial class AssistantSynonyms : AssistantBaseCore<SettingsDialogSynonym
|
|||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void ResetForm()
|
protected override void ResetForm()
|
||||||
|
|||||||
@ -32,7 +32,7 @@ public partial class AssistantTextSummarizer : AssistantBaseCore<SettingsDialogT
|
|||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void ResetForm()
|
protected override void ResetForm()
|
||||||
|
|||||||
@ -31,7 +31,7 @@ public partial class AssistantTranslation : AssistantBaseCore<SettingsDialogTran
|
|||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void ResetForm()
|
protected override void ResetForm()
|
||||||
|
|||||||
@ -1,6 +1,20 @@
|
|||||||
|
using System.Globalization;
|
||||||
|
|
||||||
namespace AIStudio.Chat;
|
namespace AIStudio.Chat;
|
||||||
|
|
||||||
public static class SystemPrompts
|
public static class SystemPrompts
|
||||||
{
|
{
|
||||||
public static readonly string DEFAULT = $"You are a helpful assistant! Today is {DateTime.Today:yyyy-MM-dd}.";
|
public static string Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var nowUtc = DateTime.UtcNow;
|
||||||
|
var nowLocal = DateTime.Now;
|
||||||
|
|
||||||
|
return string.Create(
|
||||||
|
new CultureInfo("en-US"),
|
||||||
|
$"Today is {nowUtc:MMMM d, yyyy h:mm tt} (UTC) and {nowLocal:MMMM d, yyyy h:mm tt} (local time)."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -439,7 +439,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
|||||||
SelectedProvider = this.Provider.Id,
|
SelectedProvider = this.Provider.Id,
|
||||||
SelectedProfile = this.currentProfile.Id,
|
SelectedProfile = this.currentProfile.Id,
|
||||||
SelectedChatTemplate = this.currentChatTemplate.Id,
|
SelectedChatTemplate = this.currentChatTemplate.Id,
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
WorkspaceId = this.currentWorkspaceId,
|
WorkspaceId = this.currentWorkspaceId,
|
||||||
ChatId = Guid.NewGuid(),
|
ChatId = Guid.NewGuid(),
|
||||||
DataSourceOptions = this.earlyDataSourceOptions,
|
DataSourceOptions = this.earlyDataSourceOptions,
|
||||||
@ -679,7 +679,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
|||||||
SelectedProvider = this.Provider.Id,
|
SelectedProvider = this.Provider.Id,
|
||||||
SelectedProfile = this.currentProfile.Id,
|
SelectedProfile = this.currentProfile.Id,
|
||||||
SelectedChatTemplate = this.currentChatTemplate.Id,
|
SelectedChatTemplate = this.currentChatTemplate.Id,
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
WorkspaceId = this.currentWorkspaceId,
|
WorkspaceId = this.currentWorkspaceId,
|
||||||
ChatId = Guid.NewGuid(),
|
ChatId = Guid.NewGuid(),
|
||||||
Name = string.Empty,
|
Name = string.Empty,
|
||||||
|
|||||||
@ -573,7 +573,7 @@ public partial class Workspaces : MSGComponentBase
|
|||||||
WorkspaceId = workspaceId,
|
WorkspaceId = workspaceId,
|
||||||
ChatId = Guid.NewGuid(),
|
ChatId = Guid.NewGuid(),
|
||||||
Name = string.Empty,
|
Name = string.Empty,
|
||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.Default,
|
||||||
Blocks = [],
|
Blocks = [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -263,7 +263,7 @@ public partial class ChatTemplateDialog : MSGComponentBase
|
|||||||
|
|
||||||
private void UseDefaultSystemPrompt()
|
private void UseDefaultSystemPrompt()
|
||||||
{
|
{
|
||||||
this.DataSystemPrompt = SystemPrompts.DEFAULT;
|
this.DataSystemPrompt = SystemPrompts.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Cancel() => this.MudDialog.Cancel();
|
private void Cancel() => this.MudDialog.Cancel();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user