From f00f1e89338a9e45fa1b65252fe206fd0d6f1010 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Fri, 24 May 2024 13:33:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=BB=E5=9B=BE=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/command/command.py | 2 +- model/command/openai_official.py | 5 +---- model/provider/openai_official.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/model/command/command.py b/model/command/command.py index bc9132e0b..3fa6ff98f 100644 --- a/model/command/command.py +++ b/model/command/command.py @@ -217,7 +217,7 @@ class Command: "help": "帮助", "keyword": "设置关键词/关键指令回复", "update": "更新项目", - "nick": "设置机器人昵称", + "nick": "设置机器人唤醒词", "plugin": "插件安装、卸载和重载", "web on/off": "LLM 网页搜索能力", } diff --git a/model/command/openai_official.py b/model/command/openai_official.py index 10d02fd6e..4d8d4e9f3 100644 --- a/model/command/openai_official.py +++ b/model/command/openai_official.py @@ -248,9 +248,6 @@ class CommandOpenAIOfficial(Command): async def draw(self, message: str): if self.provider is None: return False, "未启用 OpenAI 官方 API", "draw" - if message.startswith("/画"): - message = message[2:] - elif message.startswith("画"): - message = message[1:] + message = message.removeprefix("/").removeprefix("画") img_url = await self.provider.image_generate(message) return True, img_url, "draw" \ No newline at end of file diff --git a/model/provider/openai_official.py b/model/provider/openai_official.py index fff43ca15..b9debb647 100644 --- a/model/provider/openai_official.py +++ b/model/provider/openai_official.py @@ -415,7 +415,7 @@ class ProviderOpenAIOfficial(Provider): return False - async def image_generate(self, prompt, session_id, **kwargs) -> str: + async def image_generate(self, prompt: str, session_id: str = None, **kwargs) -> str: ''' 生成图片 '''