Skip to main content

nonebot-plugin-agent

此插件可帮助用户编写 Agent 插件或集成他人编写的插件,并添加至 Agent 中,帮助用户使用自然语言与你的插件生态进行交互

测试阶段目前支持私聊以及 @ 触发,请妥善管理好调用频率,以防你所使用的 LLM 服务商账户超消。后续集成用户黑白名单

Agent 默认不集成任何插件,安装支持 Agent 的插件的方式与普通插件一致。

如果你想自己编写插件,请调用 Tool.add_to_tool_list 函数。编写一个 Agent 插件的代码如下

from nonebot import require
require("nonebot_plugin_agent")
from nonebot_plugin_agent.llm import Tool

def funcx(account: str, password: str) -> str:
    return str(len(account) + len(password))


Tool.add_to_tool_list(
    funcx,
    {
        "account": {"type": "string", "description": "user's steam account"},
        "password": {"type": "string", "description": "user's steam password"}
    },
    "this function helps user calculating their amount of games in steam library, needing account and password of steam"
)

其中:

  • 第一个参数为一个 Callable 对象,支持异步与同步调用,返回值必须为一个 str 对象
  • 第二个参数为该 Callable 对象的形参参数 Schema,此处使用 Json Schema 格式
  • 第三个参数为该插件的介绍,用于帮助 LLM 更好的识别你的插件的用途

当你完成上述操作之后,便可以直接启动 Bot,此时插件已经注册到 Agent 中等待调用。

Metadata

Release files for nonebot-plugin-agent 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-agent 0.0.1
File Size Uploaded Provenance
nonebot_plugin_agent-0.0.1.tar.gz 23.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-agent 0.0.1
File Interpreter ABI Platform
nonebot_plugin_agent-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 43.8 kB

Release files / nonebot_plugin_agent-0.0.1.tar.gz

Download URL nonebot_plugin_agent-0.0.1.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d6d1d284df476be804ec99d1491b726f4085c81ecbd7bcb54817d5ffc8a83a3b
BLAKE2b-256 checksum
How to use checksums
f215e13421405791708ded03159c5467611f2091b8e09ebea3567c1dd3d0150a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.13 Darwin/22.4.0

Release files / nonebot_plugin_agent-0.0.1-py3-none-any.whl

Download URL nonebot_plugin_agent-0.0.1-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
102d88ca8387385c14010ba6ac48d16808594eef0f697f743e8d7e1148cb634f
BLAKE2b-256 checksum
How to use checksums
5f39ad061c020a8f7821b9a5852cc23ecf47819dfb3ef9eca35e83d504855f7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.13 Darwin/22.4.0

Security for nonebot-plugin-agent 0.0.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.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page