nonebot-plugin-aigfm-peer
跨 bot 通信代理插件,安装到其它 bot 上,配合主插件 nonebot-plugin-aigf-master 使用。
📖 介绍
- 捕获输出并推送:拦截本 bot 所有插件的输出(文本/图片),通过 HTTP 推送给主 bot(aigf-master),进入其 LLM 上下文(标注
[bot名]) - 远程插件调用:提供
/peer/invoke端点,接收主 bot 的远程命令调用,用 synthetic event 执行本 bot 的本地插件 - 命令推送:启动时扫描本 bot 已注册的
on_command命令,随推送告知主 bot,让 LLM 了解可调用命令(受白名单控制)
💿 安装
pip install nonebot-plugin-aigfm-peer
在 pyproject.toml 中添加:
[tool.nonebot]
plugins = ["nonebot-plugin-aigfm-peer"]
配置
在 .env 中添加:
# 主插件(Bot A)的 HTTP 端口
AIGFM_PEER_PUSH_PORT=14514
# 共享 token(与主插件 AIGFM_PEER_BOTS 中对应项一致)
AIGFM_PEER_TOKEN="shared_secret"
# 本 bot 名称(与主插件 AIGFM_PEER_BOTS 的 name 对应)
AIGFM_PEER_BOT_NAME="botB"
# 插件白名单:捕获输出 + 命令上报 + 调用核对 共用
# 非空=只捕获/上报这些插件的命令且只允许执行它们;空=捕获所有插件输出但不上报命令、调用不核对
AIGFM_PEER_CAPTURE_PLUGINS=[]
与主插件配合
- 在主插件
.env配置AIGFM_PEER_BOTS(含本 bot 的 name/port/token) - 两端 token 必须一致
- 主插件与 peer 插件的前缀(
COMMAND_START)各自独立配置,远程调用时按各 bot 的前缀自动适配
可捕获的消息类型
peer 会拦截本 bot 插件的 send_msg / send_group_msg / send_private_msg,捕获以下消息类型并推送给主 bot:
| 类型 | 推送方式 |
|---|---|
| 文本 | text 字段 |
图片(url 字段,或 file 字段为 http:// / https://) |
以 url 形式推送(image_url) |
图片(base64:// 前缀或 base64 字段) |
直接 base64 推送(image_base64) |
图片(file:// 本地路径,如 MessageSegment.image(Path(...))) |
本地读取文件转 base64 后推送(image_base64) |
受
AIGFM_PEER_CAPTURE_PLUGINS白名单过滤;主 bot 侧再按AIGFM_CAPTURE_IMAGES决定是否对图片做 VLM 描述。
License
MIT
Metadata
Release files for nonebot-plugin-aigfm-peer 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_aigfm_peer-0.3.1.tar.gz | 9.1 kB | Without provenance | Details for nonebot_plugin_aigfm_peer-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_aigfm_peer-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_aigfm_peer-0.3.1-py3-none-any.whl |
Total release size: 19.2 kB
Release files / nonebot_plugin_aigfm_peer-0.3.1.tar.gz
| Download URL | nonebot_plugin_aigfm_peer-0.3.1.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d1929e9cf29d187541786ed63e9aefb728eda0754e44e618a481a3f766cd83a5
|
|
BLAKE2b-256 checksum How to use checksums |
17125140b1b6e234aa13dab1575886cd8d2a5a675d74f258e3f00059edbc7d14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Release files / nonebot_plugin_aigfm_peer-0.3.1-py3-none-any.whl
| Download URL | nonebot_plugin_aigfm_peer-0.3.1-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc81e63dc3466c84e9675a98dedfad9ef760b40b2bd657c77205688eb6110dbe
|
|
BLAKE2b-256 checksum How to use checksums |
46301206a3fd672ce8eabc2693653cf44924d2fe168441d56f98ac945f8ce88a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Security for nonebot-plugin-aigfm-peer 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.