Skip to content

Commit

Permalink
Remove empty user message
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes committed Apr 12, 2023
1 parent cb7cd83 commit 687f828
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ChatGPT.Core/ViewModels/Chat/ChatViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ public async Task<bool> SendAsync(ChatMessageViewModel sendMessage, bool onlyAdd

if (!onlyAddMessage)
{
if (string.IsNullOrWhiteSpace(sendMessage.Message))
{
Messages.Remove(sendMessage);
}

var chatPrompt = CreateChatMessages();

_cts = new CancellationTokenSource();
Expand Down

0 comments on commit 687f828

Please sign in to comment.