Improved profile and system prompt handling (#241)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2025-01-02 14:50:54 +01:00
1 parent caec3bfd2c
commit 38a45955fb
15 files changed
+113 -46

No files matched your search

@@ -209,16 +209,12 @@ public abstract partial class AssistantBase : ComponentBase, IMessageBusReceiver
this.chatThread = new()
{
SelectedProvider = this.providerSettings.Id,
SelectedProfile = this.AllowProfiles ? this.currentProfile.Id : Profile.NO_PROFILE.Id,
SystemPrompt = this.SystemPrompt,
WorkspaceId = Guid.Empty,
ChatId = Guid.NewGuid(),
Name = string.Empty,
Name = $"Assistant - {this.Title}",
Seed = this.RNG.Next(),
SystemPrompt = !this.AllowProfiles ? this.SystemPrompt :
$"""
{this.SystemPrompt}
{this.currentProfile.ToSystemPrompt()}
""",
Blocks = [],
};
}
@@ -229,16 +225,12 @@ public abstract partial class AssistantBase : ComponentBase, IMessageBusReceiver
this.chatThread = new()
{
SelectedProvider = this.providerSettings.Id,
SelectedProfile = this.AllowProfiles ? this.currentProfile.Id : Profile.NO_PROFILE.Id,
SystemPrompt = this.SystemPrompt,
WorkspaceId = workspaceId,
ChatId = chatId,
Name = name,
Seed = this.RNG.Next(),
SystemPrompt = !this.AllowProfiles ? this.SystemPrompt :
$"""
{this.SystemPrompt}
{this.currentProfile.ToSystemPrompt()}
""",
Blocks = [],
};