From cb2859f60c9f0a7706ca527176468a39eb653d3a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 24 Aug 2025 21:44:27 -0500 Subject: [PATCH] Improve empty assistant messages --- src/components/Shakespeare/ChatPane.tsx | 49 +++++++++++++++++++++---- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/src/components/Shakespeare/ChatPane.tsx b/src/components/Shakespeare/ChatPane.tsx index 68597f0b..a134660e 100644 --- a/src/components/Shakespeare/ChatPane.tsx +++ b/src/components/Shakespeare/ChatPane.tsx @@ -1,6 +1,7 @@ import { useState, useRef, useEffect } from 'react'; import { Button } from '@/components/ui/button'; import { Textarea } from '@/components/ui/textarea'; +import { Skeleton } from '@/components/ui/skeleton'; import { Send, Settings, Play, CloudUpload, Loader2, MessageSquarePlus } from 'lucide-react'; import { useAISettings } from '@/hooks/useAISettings'; import { useFS } from '@/hooks/useFS'; @@ -354,6 +355,11 @@ BASE_DOMAIN=nostrdeploy.com`);
{messages.map((message, index) => { + // Skip assistant messages with no content + if (message.role === 'assistant' && !message.content) { + return null; + } + // Find the corresponding tool call for tool messages let toolCall: OpenAI.Chat.Completions.ChatCompletionMessageToolCall | undefined = undefined; if (message.role === 'tool' && 'tool_call_id' in message) { @@ -378,13 +384,42 @@ BASE_DOMAIN=nostrdeploy.com`); ); })} {streamingMessage && ( - + streamingMessage.content ? ( + + ) : ( +
+
+
+ +
+
+
+
+ Assistant + AI + +
+
+ + +
+
+
+ ) )}