14 lines
503 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from nonebot_plugin_marshoai.plugin import PluginMetadata, String, on_function_call
metadata = PluginMetadata(
name="天气查询", author="MarshoAI", description="一个简单的查询天气的插件"
)
@on_function_call(description="可以用于查询天气").params(
location=String(description="地点")
)
async def weather(location: str) -> str:
# 这里可以调用天气API查询天气这里只是一个简单的示例
return f"{location}的天气是晴天, 温度是25°C"