Skip to main content
在 Manus 中运行任何 Skill
一键导入
$pwd:

ag2-add-custom-tool

// Add a custom Python tool to an AG2 beta `Agent` using the `@tool` decorator. Use when the user wants to give an Agent a new capability backed by Python code (API calls, DB queries, computations, file ops). Covers sync and async tools, parameter typing, Pydantic schema customisation, returning typed `Input` / `ToolResult` (text / data / images / binary), `final=True` early-exit, and dependency injection via `Context` / `Inject` / `Variable` / `Depends`.

$ git log --oneline --stat
stars:240
forks:75
updated:2026年4月30日 23:37
文件资源管理器
2 个文件
SKILL.md
readonly