diff --git a/nonebot_plugin_marshoai/__init__.py b/nonebot_plugin_marshoai/__init__.py index 8af1a338..c323ca07 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 b2b65e3b..97d46f91 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 9454f41d..d1393f40 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]