mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 14:02:08 +08:00
feat: support compress chat history
This commit is contained in:
@@ -208,7 +208,10 @@ export function Chat(props: { showSideBar?: () => void }) {
|
||||
<IconButton
|
||||
icon={<BrainIcon />}
|
||||
bordered
|
||||
title="查看压缩后的历史 Prompt(开发中)"
|
||||
title="查看压缩后的历史 Prompt"
|
||||
onClick={() => {
|
||||
showMemoryPrompt(session.memoryPrompt)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className={styles["window-action-button"]}>
|
||||
@@ -320,6 +323,16 @@ function exportMessages(messages: Message[], topic: string) {
|
||||
})
|
||||
}
|
||||
|
||||
function showMemoryPrompt(prompt: string) {
|
||||
showModal({
|
||||
title: "上下文记忆 Prompt", children: <div className="markdown-body">
|
||||
<pre className={styles['export-content']}>{prompt}</pre>
|
||||
</div>, actions: [
|
||||
<IconButton key="copy" icon={<CopyIcon />} bordered text="全部复制" onClick={() => copyToClipboard(prompt)} />,
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
export function Home() {
|
||||
const [createNewSession] = useChatStore((state) => [state.newSession]);
|
||||
const loading = !useChatStore?.persist?.hasHydrated();
|
||||
|
Reference in New Issue
Block a user