mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-12 21:13:48 +00:00
Improved chat name generation to remove line breaks, tabs, etc. (#444)
This commit is contained in:
1 parent
6041b42510
commit
f8dbc186fb
2 files changed
+7
No files matched your search
@@ -293,6 +293,12 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
||||
// We select the first 10 words of the user input:
|
||||
var words = firstUserInput.Split(' ', StringSplitOptions.RemoveEmptyEntries);
|
||||
var threadName = string.Join(' ', words.Take(10));
|
||||
threadName = threadName.Trim();
|
||||
|
||||
// Remove all line breaks:
|
||||
threadName = threadName.Replace("\r", string.Empty);
|
||||
threadName = threadName.Replace("\n", " ");
|
||||
threadName = threadName.Replace("\t", " ");
|
||||
|
||||
// If the thread name is empty, we use a default name:
|
||||
if (string.IsNullOrWhiteSpace(threadName))
|
||||
|
||||
Reference in new issue
Block a user