Allow creation of chat thread within an existing workspace using a given name

This commit is contained in:
Thorsten Sommer 2024-10-27 14:03:09 +01:00
parent 9fe6ef9f58
commit ab1fa49f18
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -179,6 +179,27 @@ public abstract partial class AssistantBase : ComponentBase, IMessageBusReceiver
Blocks = [],
};
}
protected Guid CreateChatThread(Guid workspaceId, string name)
{
var chatId = Guid.NewGuid();
this.chatThread = new()
{
WorkspaceId = workspaceId,
ChatId = chatId,
Name = name,
Seed = this.RNG.Next(),
SystemPrompt = !this.AllowProfiles ? this.SystemPrompt :
$"""
{this.SystemPrompt}
{this.currentProfile.ToSystemPrompt()}
""",
Blocks = [],
};
return chatId;
}
protected DateTimeOffset AddUserRequest(string request)
{