From 3bd0964209dae276b5b512535f950edc8ec984e6 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 30 May 2026 21:27:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(ChatGPT):=20=E8=B0=83=E6=95=B4=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E5=8C=BA=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 缓存区移到识别提示词上方 - 缓存数量在左,清除按钮在右 - 清除缓存后自动刷新页面显示最新数量 --- plugins.v2/chatgpt/__init__.py | 91 ++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/plugins.v2/chatgpt/__init__.py b/plugins.v2/chatgpt/__init__.py index 21ef1ea..805c43b 100644 --- a/plugins.v2/chatgpt/__init__.py +++ b/plugins.v2/chatgpt/__init__.py @@ -332,6 +332,97 @@ class ChatGPT(_PluginBase): } ], }, + { + "component": "VRow", + "content": [ + { + "component": "VCol", + "props": {"cols": 12}, + "content": [ + { + "component": "VAlert", + "props": { + "type": "info", + "variant": "tonal", + "text": "识别缓存可避免相同标题重复调用 LLM API,点击按钮可清除已缓存的识别结果。", + }, + } + ], + } + ], + }, + { + "component": "VRow", + "content": [ + { + "component": "VCol", + "props": {"cols": 12, "md": 8}, + "content": [ + { + "component": "VTextField", + "props": { + "model": "cache_count", + "label": "当前缓存数量", + "readonly": True, + "hint": "点击右侧按钮清除缓存", + "persistent-hint": True, + }, + } + ], + }, + { + "component": "VCol", + "props": {"cols": 12, "md": 4}, + "content": [ + { + "component": "VBtn", + "props": { + "color": "warning", + "block": True, + "height": "56", + "onClick": { + "action": "fetch", + "url": "/plugin/ChatGPT/clear_cache", + "method": "GET", + "then": { + "action": "refresh", + }, + }, + }, + "text": "清除识别缓存", + } + ], + } + ], + }, + { + "component": "VRow", + "content": [ + { + "component": "VCol", + "props": {"cols": 12}, + "content": [ + { + "component": "VTextarea", + "props": { + "rows": 8, + "auto-grow": True, + "model": "customize_prompt", + "label": "识别增强系统提示词", + "hint": "用于约束模型只返回 MoviePilot 可消费的 JSON 识别结果", + "clearable": True, + "persistent-hint": True, + }, + } + ], + } + ], + }, + } + ], + } + ], + }, { "component": "VRow", "content": [