diff --git a/nonebot_plugin_marshoai/models.py b/nonebot_plugin_marshoai/models.py index 918bd015..0b81b27f 100644 --- a/nonebot_plugin_marshoai/models.py +++ b/nonebot_plugin_marshoai/models.py @@ -1,11 +1,6 @@ -from nonebot_plugin_alconna.uniseg.adapters import module -from requests.packages import package -from six import spec_from_loader - from .util import * from .config import config import os -import re import json import importlib import sys diff --git a/nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py b/nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py new file mode 100644 index 00000000..c590b032 --- /dev/null +++ b/nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py @@ -0,0 +1,37 @@ + +from . import mk_Info +from . import mk_Common +from . import mk_MorseCode +from . import mk_NyaCode + +# Twisuki +async def twisuki(): + return str(mk_Info.twisuki()) + +# MegaKits +async def megakits(): + return str(mk_Info.megakits()) + +# Random Turntable +async def random_turntable(upper: int, lower: int = "0"): + return str(mk_Common.random_turntable(upper, lower)) + +# Number Calc +async def number_calc(a: str, b: str, op: str): + return str(mk_Common.number_calc(a, b, op)) + +# MorseCode Encrypt +async def morse_encrypt(msg: str): + return str(mk_MorseCode.morse_encrypt(msg)) + +# MorseCode Decrypt +async def morse_decrypt(msg: str): + return str(mk_MorseCode.morse_decrypt(msg)) + +# NyaCode Encrypt +async def nya_encode(msg: str): + return str(mk_NyaCode.nya_encode(msg)) + +# NyaCode Decrypt +async def nya_decode(msg: str): + return str(mk_NyaCode.nya_decode(msg)) diff --git a/nonebot_plugin_marshoai/tools/marshoai-megakits/mk_Info.py b/nonebot_plugin_marshoai/tools/marshoai-megakits/mk_Info.py index c9611e95..f89bc32c 100644 --- a/nonebot_plugin_marshoai/tools/marshoai-megakits/mk_Info.py +++ b/nonebot_plugin_marshoai/tools/marshoai-megakits/mk_Info.py @@ -4,4 +4,4 @@ def twisuki(): # MegaKits def megakits(): - return "MegaKits插件是一个功能混杂的MarshoAI插件, 由Twisuki(Github : 'https://github.com/Twisuki')开发, 插件仓库 : 'https://github.com/Twisuki/marsho-toolsets/tree/main/Twisuki/marshoai-megakits'" + return "MegaKits插件是一个功能混杂的MarshoAI插件, 由Twisuki(Github : 'https://github.com/Twisuki')开发, 插件仓库 : 'https://github.com/LiteyukiStudio/marsho-toolsets/tree/main/Twisuki/marshoai-megakits'" diff --git a/nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json b/nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json new file mode 100644 index 00000000..397494f0 --- /dev/null +++ b/nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json @@ -0,0 +1,142 @@ +[ + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__twisuki", + "description" : "介绍插件作者Twisuki(苏阳)" + } + }, + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__megakits", + "description" : "介绍本插件MegaKits" + } + }, + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__random_turntable", + "description" : "随机转盘, 玩家输入上下限(均为整数), 返回一个随机整数", + "parameters" : { + "type" : "object", + "properties" : { + "upper" : { + "type" : "integer", + "description" : "随机数上限" + }, + "lower" : { + "type" : "integer", + "description" : "随机数下限" + } + } + }, + "require" : [ + "upper" + ] + } + }, + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__number_calc", + "description" : "数字计算器, 可对整数 小数做加减乘除, 乘方 取余运算", + "parameters" : { + "type" : "object", + "properties" : { + "a" : { + "type" : "string", + "description" : "第一个运算数" + }, + "b" : { + "type" : "string", + "description" : "第二个运算数" + }, + "op" : { + "type" : "string", + "description" : "运算符, 目前仅支持 + - * / %(取余) **(乘方)" + } + } + }, + "require" : [ + "a", "b", "op" + ] + } + }, + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__morse_encrypt", + "description" : "摩尔斯电码加密, 输入一个字符串, 返回由.- 组成的摩尔斯电码", + "parameters" : { + "type" : "object", + "properties" : { + "msg" : { + "type" : "string", + "description" : "录入的字符串(包含字母, 数字, 部分标点符号(.:,;?='/!-_\"()$&@))" + } + }, + "require" : [ + "msg" + ] + } + } + }, + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__morse_decrypt", + "description" : "摩尔斯电码解码, 输入一个字符串(由.- 组成), 返回由解码", + "parameters" : { + "type" : "object", + "properties" : { + "msg" : { + "type" : "string", + "description" : "录入的字符串(.- )" + } + }, + "require" : [ + "msg" + ] + } + } + }, + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__nya_encode", + "description" : "转换为猫猫语", + "parameters" : { + "type" : "object", + "properties" : { + "msg" : { + "type" : "string", + "description" : "待转换的字符串" + } + }, + "require" : [ + "msg" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "marshoai-megakits__nya_decode", + "description": "翻译猫语", + "parameters": { + "type": "object", + "properties": { + "msg": { + "type": "string", + "description": "录入的猫语" + } + }, + "require": [ + "msg" + ] + } + } + } +] \ No newline at end of file diff --git a/nonebot_plugin_marshoai/util.py b/nonebot_plugin_marshoai/util.py index 4ca295f7..17f3c1e4 100644 --- a/nonebot_plugin_marshoai/util.py +++ b/nonebot_plugin_marshoai/util.py @@ -96,7 +96,6 @@ async def make_chat( client: 用于与AI模型进行通信 msg: 消息内容 model_name: 指定AI模型名""" - return await client.complete( messages=msg, model=model_name, diff --git a/pyproject.toml b/pyproject.toml index 4f877a06..acb9b864 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,6 @@ plugins = ["nonebot_plugin_marshoai"] # 测试用 adapters = [ { name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11" }, - {name = "Console", module_name = "nonebot.adapters.console"}, ] [tool.pdm]