Compare commits

...

10 Commits

Author SHA1 Message Date
SeongBeomLEE
33c61333d3 Merge 80ac0c92ba into 89b5229ce9 2025-03-08 14:01:52 +03:00
ItzCrazyKns
89b5229ce9 Merge pull request #663 from ericdachen/master
Update Readme
2025-03-05 11:11:07 +05:30
ItzCrazyKns
7756340dd9 Update README.md 2025-03-05 11:09:19 +05:30
ItzCrazyKns
bbd2e9c359 feat(readme): update warp banner 2025-03-05 11:05:25 +05:30
ItzCrazyKns
a32eb1dda3 feat(readme): lint & beautify, update anchor URL 2025-03-05 10:55:02 +05:30
Eric Chen
aa834f7f04 Update README.md 2025-03-04 14:45:10 -05:00
Eric Chen
064c0fbe42 Update README.md 2025-03-04 12:16:10 -05:00
Eric Chen
bf4cf8eaeb Update README.md 2025-03-04 12:14:17 -05:00
SeongBeomLEE
80ac0c92ba [fix] Change useEffect dependence 2025-02-08 21:22:10 +09:00
SeongBeomLEE
5ed8fb47aa [fix] Problems with overlapping specific turns when generating LLM final answers 2025-02-08 20:33:44 +09:00
2 changed files with 35 additions and 5 deletions

View File

@@ -1,7 +1,22 @@
# 🚀 Perplexica - An AI-powered search engine 🔎 <!-- omit in toc -->
[![Discord](https://dcbadge.vercel.app/api/server/26aArMy8tT?style=flat&compact=true)](https://discord.gg/26aArMy8tT)
<div align="center" markdown="1">
<sup>Special thanks to:</sup>
<br>
<br>
<a href="https://www.warp.dev/perplexica">
<img alt="Warp sponsorship" width="400" src="https://github.com/user-attachments/assets/775dd593-9b5f-40f1-bf48-479faff4c27b">
</a>
### [Warp, the AI Devtool that lives in your terminal](https://www.warp.dev/perplexica)
[Available for MacOS, Linux, & Windows](https://www.warp.dev/perplexica)
</div>
<hr/>
[![Discord](https://dcbadge.vercel.app/api/server/26aArMy8tT?style=flat&compact=true)](https://discord.gg/26aArMy8tT)
![preview](.assets/perplexica-screenshot.png?)

View File

@@ -397,6 +397,8 @@ const ChatWindow = ({ id }: { id?: string }) => {
const [isMessagesLoaded, setIsMessagesLoaded] = useState(false);
const [pendingRewrite, setPendingRewrite] = useState<{ content: string; messageId: string } | null>(null);
const [notFound, setNotFound] = useState(false);
const [isSettingsOpen, setIsSettingsOpen] = useState(false);
@@ -436,6 +438,12 @@ const ChatWindow = ({ id }: { id?: string }) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const chatHistoryRef = useRef<[string, string][]>([]);
useEffect(() => {
chatHistoryRef.current = chatHistory;
}, [chatHistory]);
const messagesRef = useRef<Message[]>([]);
useEffect(() => {
@@ -478,7 +486,7 @@ const ChatWindow = ({ id }: { id?: string }) => {
files: fileIds,
focusMode: focusMode,
optimizationMode: optimizationMode,
history: [...chatHistory, ['human', message]],
history: [...chatHistoryRef.current],
}),
);
@@ -604,15 +612,22 @@ const ChatWindow = ({ id }: { id?: string }) => {
const message = messages[index - 1];
setMessages((prev) => {
return [...prev.slice(0, messages.length > 2 ? index - 1 : 0)];
return [...prev.slice(0, messages.length >= 2 ? index - 1 : 0)];
});
setChatHistory((prev) => {
return [...prev.slice(0, messages.length > 2 ? index - 1 : 0)];
return [...prev.slice(0, messages.length >= 2 ? index - 1 : 0)];
});
sendMessage(message.content, message.messageId);
setPendingRewrite({content: message.content, messageId: message.messageId});
};
useEffect(() => {
if (pendingRewrite) {
sendMessage(pendingRewrite.content, pendingRewrite.messageId);
setPendingRewrite(null);
}
}, [pendingRewrite]);
useEffect(() => {
if (isReady && initialMessage && ws?.readyState === 1) {
sendMessage(initialMessage);