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

This commit is contained in:
tsommer committed 2024-10-27 14:03:09 +01:00
1 parent 9fe6ef9f58
commit ab1fa49f18
1 file changed
+21
@@ -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)
{