mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-08-01 19:49:59 +00:00
🛠️添加小棉工具功能,移除MARSHOAI_ENABLE_TIME_PROMPT配置项
This commit is contained in:
15
nonebot_plugin_marshoai/tools/marshoai-basic/__init__.py
Normal file
15
nonebot_plugin_marshoai/tools/marshoai-basic/__init__.py
Normal file
@ -0,0 +1,15 @@
|
||||
import os
|
||||
from datetime import datetime
|
||||
from zhDateTime import DateTime
|
||||
async def get_weather(location: str):
|
||||
return f"{location}的温度是114514℃。"
|
||||
|
||||
async def get_current_env():
|
||||
ver = os.popen("uname -a").read()
|
||||
return str(ver)
|
||||
|
||||
async def get_current_time():
|
||||
current_time = datetime.now().strftime("%Y.%m.%d %H:%M:%S")
|
||||
current_lunar_date = (DateTime.now().to_lunar().date_hanzify()[5:])
|
||||
time_prompt = f"现在的时间是{current_time},农历{current_lunar_date}。"
|
||||
return time_prompt
|
11
nonebot_plugin_marshoai/tools/marshoai-basic/tools.json
Normal file
11
nonebot_plugin_marshoai/tools/marshoai-basic/tools.json
Normal file
@ -0,0 +1,11 @@
|
||||
[
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "marshoai-basic__get_current_time",
|
||||
"description": "获取现在的时间。",
|
||||
"parameters": {
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
39
nonebot_plugin_marshoai/tools/marshoai-basic/tools_test.json
Normal file
39
nonebot_plugin_marshoai/tools/marshoai-basic/tools_test.json
Normal file
@ -0,0 +1,39 @@
|
||||
[
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "marshoai-basic__get_weather",
|
||||
"description": "当你想查询指定城市的天气时非常有用。",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "城市或县区,比如北京市、杭州市、余杭区等。"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"location"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "marshoai-basic__get_current_env",
|
||||
"description": "获取当前的运行环境。",
|
||||
"parameters": {
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "marshoai-basic__get_current_time",
|
||||
"description": "获取现在的时间。",
|
||||
"parameters": {
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
Reference in New Issue
Block a user