Skip to content

Commit

Permalink
✨ 更新扩展开发文档,添加插件和工具的说明;修改获取地理位置和用户信息函数的描述
Browse files Browse the repository at this point in the history
  • Loading branch information
snowykami committed Dec 15, 2024
1 parent 84c2eb5 commit df8bc01
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions docs/zh/dev/extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,17 @@ order: 2
---

# 扩展开发

## 说明

扩展分为两类,一类为插件,一类为工具。

- 插件
- 工具(由于开发的不便利性,已经停止维护,未来可能会放弃支持,如有需求请看README中的内容,我们不推荐再使用此功能)

## 插件

插件很简单,一个Python文件,一个Python包都可以是插件,插件组成也很简单

- 元数据:包含插件的信息,如名称、版本、作者等
- 实际
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ async def get_weather(location: str, days: int, unit: str) -> str:


@on_function_call(description="获取设备物理地理位置")
async def get_location() -> str:
def get_location() -> str:
"""获取设备物理地理位置"""

# 进行一系列获取地理位置操作...

return "日本 东京都 世田谷区"


@on_function_call(description="获取聊天者个人信息")
@on_function_call(description="获取聊天者个人信息及发送的消息和function call调用参数")
async def get_user_info(e: MessageEvent, c: Caller) -> str:
return f"用户信息:{e.user_id} {e.sender.nickname}, {c._parameters}"
return f"用户ID: {e.user_id} 用户昵称: {e.sender.nickname} FC调用参数:{c._parameters} 消息内容: {e.raw_message}"

0 comments on commit df8bc01

Please sign in to comment.