mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-05 14:22:56 +00:00
Don't generate a name, when already present
This commit is contained in:
parent
cbbeae8d67
commit
978a50eb3c
@ -68,14 +68,17 @@ public partial class Chat : MSGComponentBase, IAsyncDisposable
|
|||||||
this.chatThread = deferredContent;
|
this.chatThread = deferredContent;
|
||||||
if (this.chatThread is not null)
|
if (this.chatThread is not null)
|
||||||
{
|
{
|
||||||
var firstUserBlock = this.chatThread.Blocks.FirstOrDefault(x => x.Role == ChatRole.USER);
|
if (string.IsNullOrWhiteSpace(this.chatThread.Name))
|
||||||
if (firstUserBlock is not null)
|
|
||||||
{
|
{
|
||||||
this.chatThread.Name = firstUserBlock.Content switch
|
var firstUserBlock = this.chatThread.Blocks.FirstOrDefault(x => x.Role == ChatRole.USER);
|
||||||
|
if (firstUserBlock is not null)
|
||||||
{
|
{
|
||||||
ContentText textBlock => this.ExtractThreadName(textBlock.Text),
|
this.chatThread.Name = firstUserBlock.Content switch
|
||||||
_ => "Thread"
|
{
|
||||||
};
|
ContentText textBlock => this.ExtractThreadName(textBlock.Text),
|
||||||
|
_ => "Thread"
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user