diff --git a/src/components/WhisperButton.tsx b/src/components/WhisperButton.tsx index d1570fb..b856dd6 100644 --- a/src/components/WhisperButton.tsx +++ b/src/components/WhisperButton.tsx @@ -2,6 +2,7 @@ import { createRef } from "preact"; import { ChatStore } from "@/types/chatstore"; import { StateUpdater, useEffect, useState, Dispatch } from "preact/hooks"; +import { Button } from "@/components/ui/button"; const WhisperButton = (props: { chatStore: ChatStore; @@ -12,10 +13,9 @@ const WhisperButton = (props: { const mediaRef = createRef(); const [isRecording, setIsRecording] = useState("Mic"); return ( - + ); }; diff --git a/src/pages/Chatbox.tsx b/src/pages/Chatbox.tsx index 5abfb94..b9756de 100644 --- a/src/pages/Chatbox.tsx +++ b/src/pages/Chatbox.tsx @@ -470,8 +470,7 @@ export default function ChatBOX(props: { setShow={setShowSearch} /> )} - -
{Tr("Please click above to set")} (OpenAI) API KEY
@@ -538,132 +537,131 @@ export default function ChatBOX(props: {
setChatStore={setChatStore}
/>
)}
-
- {Tr("No chat history here")}
-
- {generatingMessage || Tr("Generating...")}
- ...
-
- {chatStore.history.length > 0 && (
+ {chatStore.history.filter((msg) => !msg.example).length == 0 && (
+
+ {Tr("No chat history here")}
+
- {chatStore.postBeginIndex !== 0 && (
- <>
-
+ {generatingMessage || Tr("Generating...")}
+ ...
-
-
+ {chatStore.history.length > 0 && (
+
)}
-
- {Tr("Saved prompt templates")}
-
-
-
-
⚙{Tr("Model")}: {chatStore.model}
-
⬆{Tr("Click above to change the settings of this chat")}
-
↖{Tr("Click the conor to create a new chat")}
-
⚠
- {Tr(
- "All chat history and settings are stored in the local browser"
- )}
-
-
+ {Tr("Saved prompt templates")}
- )}
- {chatStore.develop_mode && chatStore.history.length > 0 && (
-
+
+
+
⚙{Tr("Model")}: {chatStore.model}
+
⬆{Tr("Click above to change the settings of this chat")}
+
↖{Tr("Click the conor to create a new chat")}
+
⚠
+ {Tr(
+ "All chat history and settings are stored in the local browser"
)}
+
- {Tr("Info: chat history is too long, forget messages")}:{" "}
- {chatStore.postBeginIndex}
- >
- )}
+ )}
+ {chatStore.systemMessageContent.trim() && (
+
+ {chatStore.postBeginIndex !== 0 && (
+ <>
+
+ {Tr("Info: chat history is too long, forget messages")}:{" "}
+ {chatStore.postBeginIndex}
+ >
+ )}
+
+ +
+ )} + + {images.length > 0 && (