From 2ba90ab2df8b6c853f22689ee075b0026e753689 Mon Sep 17 00:00:00 2001 From: Alessandro Pignotti Date: Mon, 3 Mar 2025 16:16:14 +0100 Subject: [PATCH] Claude: Implement clearing of the conversation history --- src/lib/AnthropicTab.svelte | 31 +++++++++++++++++++------------ src/lib/SmallButton.svelte | 11 +++++++++++ src/lib/anthropic.js | 5 +++++ 3 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 src/lib/SmallButton.svelte diff --git a/src/lib/AnthropicTab.svelte b/src/lib/AnthropicTab.svelte index a83a809..f3bc4b6 100644 --- a/src/lib/AnthropicTab.svelte +++ b/src/lib/AnthropicTab.svelte @@ -1,8 +1,9 @@ + + + + diff --git a/src/lib/anthropic.js b/src/lib/anthropic.js index c94c888..e3be3b3 100644 --- a/src/lib/anthropic.js +++ b/src/lib/anthropic.js @@ -127,6 +127,11 @@ export function addMessage(text, handleTool) plausible("ClaudeAI Use"); } +export function clearMessageHistory() { + messages.length = 0; + messageList.set(messages); +} + export function forceStop() { stopFlag = true; return new Promise((resolve) => {