modified: nonebot_plugin_marshoai/models.py

modified:   nonebot_plugin_marshoai/tools/marshoai-megakits/mk_Info.py
	modified:   nonebot_plugin_marshoai/util.py
	modified:   pyproject.toml
	nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py
	nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json
This commit is contained in:
Twisuki 2024-12-05 18:39:52 +08:00
parent 4f67d0c794
commit a13d49a06e
6 changed files with 180 additions and 8 deletions

View File

@ -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

View File

@ -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))

View File

@ -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'"

View File

@ -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"
]
}
}
}
]

View File

@ -96,7 +96,6 @@ async def make_chat(
client: 用于与AI模型进行通信
msg: 消息内容
model_name: 指定AI模型名"""
return await client.complete(
messages=msg,
model=model_name,

View File

@ -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]