From 361dcc94c87aa024e14f9768f98fb286e4b752ea Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 17 Feb 2026 20:18:50 -0700 Subject: [PATCH] Cleanup UI and prompt --- frigate/api/chat.py | 4 ++- web/src/components/chat/ChatMessage.tsx | 36 ++++++++++++++----------- web/src/pages/Chat.tsx | 3 +++ 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/frigate/api/chat.py b/frigate/api/chat.py index 761ce8b25..0aabfb52a 100644 --- a/frigate/api/chat.py +++ b/frigate/api/chat.py @@ -221,7 +221,7 @@ async def _execute_search_objects( query_params = EventsQueryParams( cameras=arguments.get("camera", "all"), labels=arguments.get("label", "all"), - sub_labels=arguments.get("sub_label", "all"), + sub_labels=arguments.get("sub_label", "all").lower(), zones=zones, zone=zones, after=after, @@ -577,6 +577,8 @@ async def chat_completion( Current server local date and time: {current_date_str} at {current_time_str} +Do not start your response with phrases like "I will check...", "Let me see...", or "Let me look...". Answer directly. + Always present times to the user in the server's local timezone. When tool results include start_time_local and end_time_local, use those exact strings when listing or describing detection times—do not convert or invent timestamps. Do not use UTC or ISO format with Z for the user-facing answer unless the tool result only provides Unix timestamps without local time fields. When users ask about "today", "yesterday", "this week", etc., use the current date above as reference. When searching for objects or events, use ISO 8601 format for dates (e.g., {current_date_str}T00:00:00Z for the start of today). diff --git a/web/src/components/chat/ChatMessage.tsx b/web/src/components/chat/ChatMessage.tsx index 689ee5f01..4470db736 100644 --- a/web/src/components/chat/ChatMessage.tsx +++ b/web/src/components/chat/ChatMessage.tsx @@ -19,6 +19,7 @@ type MessageBubbleProps = { content: string; messageIndex?: number; onEditSubmit?: (messageIndex: number, newContent: string) => void; + isComplete?: boolean; }; export function MessageBubble({ @@ -26,6 +27,7 @@ export function MessageBubble({ content, messageIndex = 0, onEditSubmit, + isComplete = true, }: MessageBubbleProps) { const { t } = useTranslation(["views/chat", "common"]); const isUser = role === "user"; @@ -152,21 +154,25 @@ export function MessageBubble({ )} - - - - - {t("button.copy", { ns: "common" })} - + {isComplete && ( + + + + + + {t("button.copy", { ns: "common" })} + + + )} ); diff --git a/web/src/pages/Chat.tsx b/web/src/pages/Chat.tsx index d5a510a41..cd5b26bab 100644 --- a/web/src/pages/Chat.tsx +++ b/web/src/pages/Chat.tsx @@ -104,6 +104,9 @@ export default function ChatPage() { onEditSubmit={ msg.role === "user" ? handleEditSubmit : undefined } + isComplete={ + msg.role === "user" || !isLoading || i < messages.length - 1 + } /> ))}