feat: AI 聊天面板多模态增强及交互优化
- 支持视频/音频/PDF/文档等多文件类型上传(最大20MB,最多4个) - 视频用 image_url 格式传递(兼容 Gemini OpenAI 兼容层) - 发送前自动生成图片/视频缩略图,聊天记录中显示预览 - 新增消息编辑、重新生成、复制功能 - 支持 reasoning_content 思考过程折叠显示 - 历史对话支持重命名 - 修复 localStorage 存储优化(strip 大文件数据,保留缩略图) - 新增删除历史记录 API 及重启按钮前端组件 Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
@@ -72,6 +72,22 @@ app.registerExtension({
|
||||
}
|
||||
};
|
||||
|
||||
// --- Patch deleteItem: 同时删除 o1key 持久化记录和文件 ---
|
||||
const _origDeleteItem = api.deleteItem.bind(api);
|
||||
api.deleteItem = async function (type, id) {
|
||||
const result = await _origDeleteItem(type, id);
|
||||
if (type === "history" && enabled()) {
|
||||
try {
|
||||
await fetch("/o1key/delete_history", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ delete: [id] }),
|
||||
});
|
||||
} catch (e) {}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
// --- Patch getJobDetail: 真实 API 失败时回退到本地路由 ---
|
||||
const _origGetJobDetail = api.getJobDetail.bind(api);
|
||||
api.getJobDetail = async function (jobId) {
|
||||
|
||||
Reference in New Issue
Block a user