|
|
@ -874,12 +874,6 @@ function _Chat() {
|
|
|
|
context.push(copiedHello);
|
|
|
|
context.push(copiedHello);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// clear context index = context length + index in messages
|
|
|
|
|
|
|
|
const clearContextIndex =
|
|
|
|
|
|
|
|
(session.clearContextIndex ?? -1) >= 0
|
|
|
|
|
|
|
|
? session.clearContextIndex! + context.length
|
|
|
|
|
|
|
|
: -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// preview messages
|
|
|
|
// preview messages
|
|
|
|
const renderMessages = useMemo(() => {
|
|
|
|
const renderMessages = useMemo(() => {
|
|
|
|
return context
|
|
|
|
return context
|
|
|
@ -961,6 +955,12 @@ function _Chat() {
|
|
|
|
scrollDomToBottom();
|
|
|
|
scrollDomToBottom();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// clear context index = context length + index in messages
|
|
|
|
|
|
|
|
const clearContextIndex =
|
|
|
|
|
|
|
|
(session.clearContextIndex ?? -1) >= 0
|
|
|
|
|
|
|
|
? session.clearContextIndex! + context.length - msgRenderIndex
|
|
|
|
|
|
|
|
: -1;
|
|
|
|
|
|
|
|
|
|
|
|
const [showPromptModal, setShowPromptModal] = useState(false);
|
|
|
|
const [showPromptModal, setShowPromptModal] = useState(false);
|
|
|
|
|
|
|
|
|
|
|
|
const clientConfig = useMemo(() => getClientConfig(), []);
|
|
|
|
const clientConfig = useMemo(() => getClientConfig(), []);
|
|
|
|