From 633c8bad97590566305aa20d36820f7ef52d45ee Mon Sep 17 00:00:00 2001 From: TimoYoung Date: Wed, 21 Jan 2026 17:30:59 +0800 Subject: [PATCH] =?UTF-8?q?autosubv2:=20v2.4=20=E9=80=82=E9=85=8Dopenai=20?= =?UTF-8?q?api=20v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 5 +++-- plugins/autosubv2/__init__.py | 2 +- plugins/autosubv2/translate/openai_translate.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 010efec..5b62c4a 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "name": "AI字幕自动生成(v2)", "description": "使用whisper自动生成视频文件字幕,使用大模型翻译字幕成中文。", "labels": "字幕", - "version": "2.3", + "version": "2.4", "icon": "autosubtitles.jpeg", "author": "TimoYoung", "level": 1, @@ -38,7 +38,8 @@ "v2.0": "1.引入任务队列 2.支持监听媒体入库自动生成字幕 3.增加任务状态展示界面", "v2.1": "支持清除历史记录", "v2.2": "fix", - "v2.3": "支持独立的大模型调用配置" + "v2.3": "支持独立的大模型调用配置", + "v2.4": "适配openai api v1" } }, "CustomSites": { diff --git a/plugins/autosubv2/__init__.py b/plugins/autosubv2/__init__.py index 382ea15..b85cd21 100644 --- a/plugins/autosubv2/__init__.py +++ b/plugins/autosubv2/__init__.py @@ -66,7 +66,7 @@ class AutoSubv2(_PluginBase): # 主题色 plugin_color = "#2C4F7E" # 插件版本 - plugin_version = "2.3" + plugin_version = "2.4" # 插件作者 plugin_author = "TimoYoung" # 作者主页 diff --git a/plugins/autosubv2/translate/openai_translate.py b/plugins/autosubv2/translate/openai_translate.py index c924e1b..aa0e49c 100644 --- a/plugins/autosubv2/translate/openai_translate.py +++ b/plugins/autosubv2/translate/openai_translate.py @@ -92,7 +92,7 @@ class OpenAi: "content": message } ] - return openai.ChatCompletion.create( + return self.client.chat.completions.create( model=self._model, user=user, messages=message,