mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 19:19:47 +00:00
Optimized thread name generation
This commit is contained in:
parent
5e445f09fa
commit
199693dfbd
@ -252,8 +252,6 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
|||||||
await this.inputField.BlurAsync();
|
await this.inputField.BlurAsync();
|
||||||
|
|
||||||
// Create a new chat thread if necessary:
|
// Create a new chat thread if necessary:
|
||||||
var threadName = this.ExtractThreadName(this.userInput);
|
|
||||||
|
|
||||||
if (this.ChatThread is null)
|
if (this.ChatThread is null)
|
||||||
{
|
{
|
||||||
this.ChatThread = new()
|
this.ChatThread = new()
|
||||||
@ -263,7 +261,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
|||||||
SystemPrompt = SystemPrompts.DEFAULT,
|
SystemPrompt = SystemPrompts.DEFAULT,
|
||||||
WorkspaceId = this.currentWorkspaceId,
|
WorkspaceId = this.currentWorkspaceId,
|
||||||
ChatId = Guid.NewGuid(),
|
ChatId = Guid.NewGuid(),
|
||||||
Name = threadName,
|
Name = this.ExtractThreadName(this.userInput),
|
||||||
Seed = this.RNG.Next(),
|
Seed = this.RNG.Next(),
|
||||||
Blocks = [],
|
Blocks = [],
|
||||||
};
|
};
|
||||||
@ -274,7 +272,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
|||||||
{
|
{
|
||||||
// Set the thread name if it is empty:
|
// Set the thread name if it is empty:
|
||||||
if (string.IsNullOrWhiteSpace(this.ChatThread.Name))
|
if (string.IsNullOrWhiteSpace(this.ChatThread.Name))
|
||||||
this.ChatThread.Name = threadName;
|
this.ChatThread.Name = this.ExtractThreadName(this.userInput);
|
||||||
|
|
||||||
// Update provider and profile:
|
// Update provider and profile:
|
||||||
this.ChatThread.SelectedProvider = this.Provider.Id;
|
this.ChatThread.SelectedProvider = this.Provider.Id;
|
||||||
|
Loading…
Reference in New Issue
Block a user