improve reset conversation ui

This commit is contained in:
binary-husky
2025-05-06 22:10:21 +08:00
parent 883b513b91
commit eba48a0f1a
3 changed files with 11 additions and 2 deletions

View File

@@ -34,7 +34,7 @@ def encode_plugin_info(k, plugin)->str:
def main(): def main():
import gradio as gr import gradio as gr
if gr.__version__ not in ['3.32.12', '3.32.13']: if gr.__version__ not in ['3.32.14', '3.32.13']:
raise ModuleNotFoundError("使用项目内置Gradio获取最优体验! 请运行 `pip install -r requirements.txt` 指令安装内置Gradio及其他依赖, 详情信息见requirements.txt.") raise ModuleNotFoundError("使用项目内置Gradio获取最优体验! 请运行 `pip install -r requirements.txt` 指令安装内置Gradio及其他依赖, 详情信息见requirements.txt.")
# 一些基础工具 # 一些基础工具

View File

@@ -1,4 +1,4 @@
https://public.agent-matrix.com/publish/gradio-3.32.13-py3-none-any.whl https://public.agent-matrix.com/publish/gradio-3.32.14-py3-none-any.whl
fastapi==0.110 fastapi==0.110
gradio-client==0.8 gradio-client==0.8
pypdf2==2.12.1 pypdf2==2.12.1

View File

@@ -1184,6 +1184,15 @@ async function clear_conversation(a, b, c) {
update_conversation_metadata(); update_conversation_metadata();
let stopButton = document.getElementById("elem_stop"); let stopButton = document.getElementById("elem_stop");
stopButton.click(); stopButton.click();
// Save back to local storage
try {
const EVENT_NAME = "gptac_reset_btn_clicked";
window.dispatchEvent(
new CustomEvent(EVENT_NAME, {
detail: ""
})
);
} catch (e) {}
return reset_conversation(a, b); return reset_conversation(a, b);
} }