diff --git a/src/Purrse.Api/Services/ChatService.cs b/src/Purrse.Api/Services/ChatService.cs index 0a94c0c..87f41d6 100644 --- a/src/Purrse.Api/Services/ChatService.cs +++ b/src/Purrse.Api/Services/ChatService.cs @@ -248,7 +248,9 @@ public class ChatService : IChatService } else { - var rawContent = response?.Message?.Content ?? "I'm sorry, I couldn't process that request."; + var rawContent = string.IsNullOrWhiteSpace(response?.Message?.Content) + ? "I'm sorry, I couldn't process that request." + : response!.Message!.Content; // If the model responded without calling any tools on the first attempt // AND there are no prior tool results AND no page context data, it