Improved chat name generation to remove line breaks, tabs, etc. (#444)

This commit is contained in:
Thorsten Sommer 2025-05-03 16:25:51 +02:00 committed by GitHub
parent 6041b42510
commit f8dbc186fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -293,6 +293,12 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
// We select the first 10 words of the user input: // We select the first 10 words of the user input:
var words = firstUserInput.Split(' ', StringSplitOptions.RemoveEmptyEntries); var words = firstUserInput.Split(' ', StringSplitOptions.RemoveEmptyEntries);
var threadName = string.Join(' ', words.Take(10)); 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 the thread name is empty, we use a default name:
if (string.IsNullOrWhiteSpace(threadName)) if (string.IsNullOrWhiteSpace(threadName))

View File

@ -4,6 +4,7 @@
- Improved the model selection for OpenAI by removing all `o1-pro` models. These models cannot be used right now, since OpenAI introduced a new API, which is not yet supported by MindWork AI Studio. - Improved the model selection for OpenAI by removing all `o1-pro` models. These models cannot be used right now, since OpenAI introduced a new API, which is not yet supported by MindWork AI Studio.
- Improved the internal plugin maintenance so that removed resources are now removed from the file system. - Improved the internal plugin maintenance so that removed resources are now removed from the file system.
- Improved the app settings to apply the chosen language immediately. - Improved the app settings to apply the chosen language immediately.
- Improved chat name generation to prevent the inclusion of line breaks, tabs, and other special characters.
- Fixed an issue where empty lines in source code were being ignored by the Markdown renderer. Thanks My Nihongo for fixing this bug in the `MudBlazor.Markdown` repository. - Fixed an issue where empty lines in source code were being ignored by the Markdown renderer. Thanks My Nihongo for fixing this bug in the `MudBlazor.Markdown` repository.
- Fixed the localization assistant not being able to load the localization file when used in the release app. - Fixed the localization assistant not being able to load the localization file when used in the release app.
- Upgraded Rust & .NET dependencies. - Upgraded Rust & .NET dependencies.