From fc25a5c18479e772367a5447622aea908f9c7451 Mon Sep 17 00:00:00 2001 From: Asankilp Date: Wed, 2 Oct 2024 10:49:58 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9Bv0.1.2=EF=BC=8C=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E9=A1=B9=E4=BF=AE=E6=94=B9=EF=BC=8C=E4=BF=AE=E5=A4=8D=E9=9D=9E?= =?UTF-8?q?=E5=8F=AF=E5=A4=84=E7=90=86=E5=9B=BE=E7=89=87=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=9C=AA=E5=8E=BB=E9=99=A4marsho=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_marshoai/__init__.py | 2 ++ nonebot_plugin_marshoai/azure.py | 2 +- pyproject.toml | 8 ++------ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/nonebot_plugin_marshoai/__init__.py b/nonebot_plugin_marshoai/__init__.py index 8af1a33..c323ca0 100644 --- a/nonebot_plugin_marshoai/__init__.py +++ b/nonebot_plugin_marshoai/__init__.py @@ -2,6 +2,7 @@ from nonebot.plugin import PluginMetadata, inherit_supported_adapters, require require("nonebot_plugin_alconna") from .azure import * from nonebot import get_driver +from .config import ConfigModel usage = """MarshoAI Alpha by Asankilp 用法: marsho <聊天内容> : 与 Marsho 进行对话。当模型为 GPT-4o(-mini) 等时,可以带上图片进行对话。 @@ -22,6 +23,7 @@ __plugin_meta__ = PluginMetadata( description="接入Azure服务的AI聊天插件", usage=usage, type="application", + config=ConfigModel, homepage="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai", supported_adapters=inherit_supported_adapters("nonebot_plugin_alconna"), extra={"License":"MIT","Author":"Asankilp"} diff --git a/nonebot_plugin_marshoai/azure.py b/nonebot_plugin_marshoai/azure.py index b2b65e3..97d46f9 100644 --- a/nonebot_plugin_marshoai/azure.py +++ b/nonebot_plugin_marshoai/azure.py @@ -114,7 +114,7 @@ async def marsho( if is_support_image_model: usermsg.append(TextContentItem(text=clean_text)) else: - usermsg += str(i.data["text"]) + usermsg += str(clean_text) response = await client.complete( messages=context.build(target.id, target.private)+[UserMessage(content=usermsg)], model=model_name diff --git a/pyproject.toml b/pyproject.toml index 9454f41..d1393f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [project] name = "nonebot-plugin-marshoai" -version = "0.1.1" +version = "0.1.2" description = "Nonebot2插件,调用Azure OpenAI服务实现猫娘聊天" readme = "README.md" requires-python = "<4.0,>=3.9" authors = [{ name = "Asankilp", email = "asankilp@outlook.com" }] dependencies = [ - "nonebot2[fastapi, websockets]>=2.2.0", + "nonebot2>=2.2.0", "nonebot-plugin-alconna>=0.48.0", "azure-ai-inference>=1.0.0b4", "zhDatetime>=1.1.1", @@ -21,10 +21,6 @@ Homepage = "https://github.com/LiteyukiStudio/nonebot-plugin-marshoai" [tool.nonebot] plugins = ["nonebot_plugin_marshoai"] -adapters = [ - { name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11" }, - -] [tool.pdm]