内容
<div align="center">
<img src="https://capsule-render.vercel.app/api?type=waving&color=0:0a0a1a,30:0d0d2b,60:1a0a3a,100:0d1b4a&height=240§ion=header&text=npmai_agents&fontSize=82&fontColor=00f5ff&fontAlignY=38&desc=1%2C371%20Tools.%20100%20Classes.%20One%20Package.%20Zero%20Cost.&descColor=a78bfa&descAlignY=60&animation=twinkling" width="100%"/>
<a href="https://npmai.netlify.app">
<img src="https://readme-typing-svg.demolab.com?font=Fira+Code&size=18&duration=2500&pause=800&color=00F5FF¢er=true&vCenter=true&multiline=false&width=800&lines=1%2C371+verified+tools+across+100+classes;5-role+autonomous+LLM+pipeline+%E2%86%92+Plan+%E2%86%92+Select+%E2%86%92+Code+%E2%86%92+Audit+%E2%86%92+Verify;12+LLM+providers+%E2%80%94+NPMAI%2C+OpenAI%2C+Groq%2C+Anthropic%2C+Gemini+%26+more;Built+by+Sonu+Kumar+%C2%B7+NPMAI+ECOSYSTEM+%C2%B7+Free+Forever" alt="Typing SVG"/>
</a>
<br/>
<br/>
<img src="https://img.shields.io/badge/PyPI-npmai__agents-00f5ff?style=for-the-badge&logo=pypi&logoColor=white&labelColor=0a0a1a"/>
<img src="https://img.shields.io/badge/Version-1.0.0-a78bfa?style=for-the-badge&labelColor=0a0a1a"/>
<img src="https://img.shields.io/badge/Python-3.9%2B-00f5ff?style=for-the-badge&logo=python&logoColor=white&labelColor=0a0a1a"/>
<img src="https://img.shields.io/badge/License-MIT-2affa0?style=for-the-badge&labelColor=0a0a1a"/>
<img src="https://img.shields.io/badge/Status-Production%20Stable-2affa0?style=for-the-badge&labelColor=0a0a1a"/>
<br/>
<img src="https://img.shields.io/badge/Tools-1%2C371-ff6b9d?style=for-the-badge&labelColor=0a0a1a"/>
<img src="https://img.shields.io/badge/Classes-100-a78bfa?style=for-the-badge&labelColor=0a0a1a"/>
<img src="https://img.shields.io/badge/LLM%20Roles-5-00f5ff?style=for-the-badge&labelColor=0a0a1a"/>
<img src="https://img.shields.io/badge/LLM%20Providers-12-ff6b9d?style=for-the-badge&labelColor=0a0a1a"/>
<img src="https://img.shields.io/badge/NPMAI-ECOSYSTEM-00f5ff?style=for-the-badge&labelColor=0a0a1a"/>
<br/>
<br/>
**[`🌐 Website`](https://npmai.netlify.app)** · **[`📦 PyPI`](https://pypi.org/project/npmai_agents)** · **[`🐙 GitHub`](https://github.com/sonuramashishnpm/npmai-agent)** · **[`👤 Founder`](https://github.com/sonuramashishnpm)**
</div>
---
## ✦ 什么是 npmai_agents?
**npmai_agents** 是一个生产级别的、开源的自主人工智能代理框架,包含 **1,371 个已验证的工具,跨越 100 个类别** —— 这是有史以来构建的最大开源本地工具注册表。一个 **5 角色的 LLM 管道**(规划器 → 工具管理器 → 代码生成器 → 审计员 → 验证器)自主执行您计算机上的任何纯英文任务,使用 **12 个支持的 LLM 提供商**,包括 NPMAI 免费 LLMs、OpenAI、Groq、Anthropic、Gemini 等。
核心洞察:LLM 大部分时间都浪费在反向工程 API 文档上,而不是解决您的实际问题。npmai_agents 中的每个类别都附带一个 `use` 变量 —— 预编译的结构化工具知识,管道按需读取。规划器看到 100 个类别的单行索引。工具管理器仅为任务实际需要的类别深入文档。代码生成器接收确切的方法签名和调用示例。API 形状上没有幻觉。任务逻辑上的最大智能。
---
## 🏛️ NPMAI 生态系统
<table>
<tr>
<td width="55%">
**npmai_agents** 是 **[NPMAI 生态系统](https://npmai.netlify.app)** 的产品 —— 一个由 **Sonu Kumar** (Bihar Viral Boy)创立的免费、开源的人工智能研究和开发平台,Sonu Kumar 是一名 15 岁的自学成才的 AI 开发人员、TEDx 演讲者和宪法研究员,来自印度比哈尔邦。
</td>
<td width="45%">
| 指标 | 值 |
|---|---|
| PyPI 下载量 | `2,500,000+` |
| 每日请求量 | `80,000+` |
| 免费 LLMs | `45+` |
| 每月成本 | `₹0` |
</td>
</tr>
</table>
[](https://npmai.netlify.app)
[](https://github.com/sonuramashishnpm)
[](https://pypi.org/project/npmai)
---
## ⚡ 安装
```bash
# 最简安装 —— 代理在运行时自动安装工具依赖
pip install npmai_agents
# 完整安装 —— 所有 1,371 个工具依赖预先安装
pip install npmai_agents[full]
```
```python
# 导入样式
from npmai_agents import AgentBrain # 仅限代理
from npmai_agents import StripeTool, GitHubTool, FFmpegTool # 特定工具
from npmai_agents import * # 所有内容
```
---
## 🖥️ CLI — 完整参考
安装为您提供全局的 `npmai` 命令行命令。
```bash
npmai --help
```
---
### `npmai run` — 执行任意任务
通过完整的 5 角色自主管道运行纯英文任务。
| 参数 | 类型 | 默认值 | 必需 | 描述 |
|---|---|---|---|---|
| `task` | `str` | — | ✅ | 要执行的纯英文任务描述 |
```bash
npmai run "从 arXiv 今日抓取前 10 篇 AI 论文,总结每篇 3 句话,保存到 Excel,然后通过电子邮件发送给我"
npmai run "查找我的下载文件夹中的所有重复文件并删除它们"
npmai run "从我的 GitHub 仓库拉取最新版本,运行测试并将结果发布到 Slack #dev"
npmai run "为 john@example.com 创建一个 Stripe 客户并生成一张 5000 卢比的发票"
```
**输出:** 显示每个管道阶段的流式日志 —— 规划 → 工具选择 → 代码生成 → 安全审计 → 执行 → 验证。成功时为 `✓ 所有步骤成功完成`。
---
### `npmai chat` — 会话模式
将消息发送到会话聊天 LLM,而不会触发完整的代理管道。
| 参数 | 类型 | 默认值 | 必需 | 描述 |
|---|---|---|---|---|
| `user_msg` | `str` | — | ✅ | 您的消息或问题 |
```bash
npmai chat "什么是 LARA RAG 架构?"
npmai chat "如何使用 StripeTool 创建订阅?"
npmai chat "解释一下管道中的 Tool Manager 角色"
```
**输出:** 来自聊天 LLM 的直接对话响应(默认:`granite3.3:2b`)。
---
### `npmai config-agent` — 配置 LLM 后端
使用自定义 LLM 提供商和模型为每个管道角色重新配置代理。
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| `--planner-model` | `str` | `llama3.2:3b` | 规划器角色的模型 |
| `--planner-provider` | `str` | `npmai` | 规划器角色的提供商 |
| `--coder-model` | `str` | `codellama:7b-instruct` | 代码生成器角色的模型 |
| `--coder-provider` | `str` | `npmai` | 代码生成器角色的提供商 |
| `--auditor-model` | `str` | `qwen2.5-coder:7b` | 审计员角色的模型 |
| `--auditor-provider` | `str` | `npmai` | 审计员角色的提供商 |
| `--verifier-model` | `str` | `llama3.2:3b` | 验证器角色的模型 |
| `--verifier-provider` | `str` | `npmai` | 验证器角色的提供商 |
| `--chatter-model` | `str` | `granite3.3:2b` | 聊天角色的模型 |
| `--chatter-provider` | `str` | `npmai` | 聊天角色的提供商 |
```bash
# 默认 — 所有 NPMAI 免费 LLMs,无需配置
npmai run "我的任务"
# 所有 Groq
npmai config-agent \
--planner-provider groq --planner-model llama-3.3-70b-versatile \
--coder-provider groq --coder-model llama-3.3-70b-versatile \
--auditor-provider groq --auditor-model llama-3.3-70b-versatile \
--verifier-provider groq --verifier-model llama-3.3-70b-versatile
# 混合 — 每个角色的最佳模型
npmai config-agent \
--planner-provider groq --planner-model llama-3.3-70b-versatile \
--coder-provider openai --coder-model gpt-4o \
--auditor-provider anthropic --auditor-model claude-sonnet-4-6 \
--verifier-provider npmai --verifier-model llama3.2:3b
```
**提供商参考:
| 提供商 | `--provider` 值 | 示例模型 | 是否需要保存凭证 |
|---|---|---|---|
| NPMAI 免费 | `npmai` | `llama3.2:3b` | 不需要 |
| 本地 Ollama | `local` | `llama3.2:3b` | 不需要 |
| OpenAI | `openai` | `gpt-4o` | `npmai save-credentials openai '{"api_key":"sk-xxx"}'` |
| Groq | `groq` | `llama-3.3-70b-versatile` | `npmai save-credentials groq '{"api_key":"gsk_xxx"}'` |
| Anthropic | `anthropic` | `claude-sonnet-4-6` | `npmai save-credentials anthropic '{"api_key":"sk-ant-xxx"}'` |
| Gemini | `gemini` | `gemini-2.0-flash` | `npmai save-credentials gemini '{"api_key":"AIza-xxx"}'` |
| Mistral | `mistral` | `mistral-large-latest` | `npmai save-credentials mistral '{"api_key":"xxx"}'` |
| Cohere | `cohere` | `command-r-plus` | `npmai save-credentials cohere '{"api_key":"xxx"}'` |
| Azure OpenAI | `azure` | `gpt-4o` | `npmai save-credentials azure '{"api_key":"xxx","endpoint":"https://xxx.openai.azure.com","deployment":"gpt-4o"}'` |
| AWS Bedrock | `bedrock` | `anthropic.claude-3-sonnet` | `npmai save-credentials bedrock '{"aws_access_key":"xxx","aws_secret_key":"xxx","region":"us-east-1"}'` |
| HuggingFace | `hf` | `mistralai/Mistral-7B-Instruct-v0.3` | `npmai save-credentials hf '{"api_key":"hf_xxx"}'` |
| llama.cpp | `llamacpp` | `/path/to/model.gguf` | 不需要 |
---
### `npmai save-credentials` — 存储 API 密钥
使用 Fernet 机器特定密钥将凭证加密存储到 `~/.npmai_agent/creds.json`。
| 参数 | 类型 | 必需 | 描述 |
|---|---|---|---|
| `name` | `str` | ✅ | 凭证名称/标识符 |
| `data` | `str` | ✅ | 凭证数据 JSON 字符串 |
```bash
npmai save-credentials github '{"token":"ghp_xxxxxxxxxxxx"}'
npmai save-credentials openai '{"api_key":"sk-xxxxxxxxxxxx"}'
npmai save-credentials groq '{"api_key":"gsk_xxxxxxxxxxxx"}'
npmai save-credentials stripe '{"secret_key":"sk_live_xxxxxxxxxxxx"}'
npmai save-credentials slack '{"bot_token":"xoxb-xxxxxxxxxxxx"}'
npmai save-credentials sendgrid '{"api_key":"SG.xxxxxxxxxxxx"}'
npmai save-credentials anthropic '{"api_key":"sk-ant-xxxxxxxxxxxx"}'
npmai save-credentials '{"api_key":"SG.xxxxxxxxxxxx"}'
npmai save-credentials notion '{"token":"secret_xxxxxxxxxxxx"}'` |
```python
from npmai_agents import CredStore
CredStore.save("stripe-tool": "StripeTool", GitHubTool, FFmpegTool # 特定工具
from npmai_agents import * # 所有内容
```
---
## 🖥️ 完整工具参考 — 1,371 个工具,涵盖 100 个类别
---
## ◈ 开发人员和 CLI 工具 — 155 个工具
---
### GitTool — 24 个工具
本地 Git 版本控制 — 从 init 到 rebase 的完整工作流程。
```python
from npmai_agents import GitTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `init` | 初始化新仓库 | `path` |
| `clone` | 克隆远程仓库 | `url, dest` |
| `status` | 显示工作树状态 | `path` |
| `add` | 暂存文件 | `path, files="."` |
| `commit` | 提交暂存更改 | `path, message` |
| `push` | 推送到远程仓库 | `path, branch="main"` |
| `pull` | 从远程仓库拉取 | `path, branch="main"` |
| `fetch` | 获取远程更改 | `path, remote="origin"` |
| `create_branch` | 创建新分支 | `path, branch_name` |
| `checkout` | 切换分支 | `path, branch` |
| `merge` | 合并分支到当前分支 | `path, branch` |
| `log` | 显示提交历史 | `path, limit=10` |
| `diff` | 显示未暂存更改 | `path` |
| `stash` | 暂存工作目录 | `path` |
| `stash_pop` | 弹出 stash | `path` |
| `tag` | 创建标签 | `path, tag_name` |
| `reset` | 重置到提交 | `path, commit="HEAD", mode="mixed"` |
| `rebase` | 变基到分支 | `path, branch` |
| `cherry_pick` | 选取提交 | `path, commit_hash` |
| `blame` | 显示行作者信息 | `path, file` |
| `show` | 显示提交详情 | `path, commit` |
| `remote_add` | 添加远程仓库 | `path, name, url` |
| `remote_list` | 列出远程仓库 | `path` |
| `submodule_init` | 初始化子模块 | `path` |
```python
GitTool.init("/home/sonu/project")
GitTool.clone("https://github.com/sonuramashishnpm/npmai.git", "/home/sonu/npmai")
GitTool.add("/home/sonu/npmai", ".")
GitTool.commit("/home/sonu/npmai", "feat: add tool manager LLM role")
GitTool.create_branch("/home/sonu/npmai", "feature/tool-manager")
GitTool.push("/home/sonu/npmai", "feature/tool-manager")
GitTool.log("/home/sonu/npmai", limit=5)
```
### GitHub 工具 — 24 个工具
完整的 GitHub API — 仓库、问题、拉取请求、发布、Actions、文件。
```python
from npmai_agents import GitHubTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `create_repo` | 创建新仓库 | `name, private=False, description=""` |
| `delete_repo` | 删除仓库 | `owner, repo` |
| `fork_repo` | 复制仓库 | `owner, repo` |
| `create_issue` | 创建问题 | `owner_repo, title, body, labels=[]` |
| `close_issue` | 关闭问题 | `owner_repo, issue_number` |
| `list_issues` | 列出开放问题 | `owner_repo, state="open"` |
| `create_pr` | 创建拉取请求 | `owner_repo, title, base, head, body=""` |
| `merge_pr` | 合并拉取请求 | `owner_repo, pr_number` |
| `list_prs` | 列出拉取请求 | `owner_repo, state="open"` |
| `review_pr` | 提交 PR 审查 | `owner_repo, pr_number, body, event` |
| `push_file` | 创建/更新文件 | `owner_repo, path, content, message` |
| `delete_file` | 删除文件 | `owner_repo, path, message` |
| `get_file` | 获取文件内容 | `owner_repo, path` |
| `list_files` | 列出目录内容 | `owner_repo, path=""` |
| `create_release` | 创建发布 | `owner_repo, tag, name, body=""` |
| `get_actions_status` | 获取工作流运行状态 | `owner_repo` |
| `trigger_workflow` | 触发工作流 | `owner_repo, workflow_file, ref="main"` |
| `list_branches` | 列出分支 | `owner_repo` |
| `protect_branch` | 添加分支保护 | `owner_repo, branch` |
| `add_collaborator` | 添加协作者 | `owner_repo, username, permission="push"` |
| `create_gist` | 创建代码片段 | `description, files, public=True` |
| `get_user_info` | 获取用户信息 | `username` |
| `star_repo` | 星标仓库 | `owner_repo` |
| `watch_repo` | 关注仓库 | `owner_repo` |
```python
GitHubTool.create_issue("sonuramashishnpm/npmai-agent", "工具管理器集成", "实现 2 阶段工具选择", labels=["增强"])
GitHubTool.create_pr("sonuramashishnpm/npmai-agent", "feat: 工具管理器", "main", "feature/tool-manager")
GitHubTool.push_file("sonuramashishnpm/npmai-agent", "README.md", readme_content, "docs: 更新 README 至 v1.0.0")
GitHubTool.create_release("sonuramashishnpm/npmai-agent", "v1.0.0", "生产版本", "1,371 个工具,跨 100 个类")
GitHubTool.trigger_workflow("sonuramashishnpm/npmai-agent", "publish.yml")
```
---
### GitLab 工具 — 16 个工具
GitLab API — 项目、问题、合并请求、流水线、成员。
```python
from npmai_agents import GitLabTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `create_project` | 创建新项目 | `name, description="", visibility="private"` |
| `list_projects` | 列出项目 | `owned=True` |
| `get_project` | 获取项目详情 | `project_id` |
| `create_issue` | 创建问题 | `project_id, title, description=""` |
| `close_issue` | 关闭问题 | `project_id, issue_iid` |
| `create_mr` | 创建合并请求 | `project_id, title, source, target` |
| `merge_mr` | 合并合并请求 | `project_id, mr_iid` |
| `list_pipelines` | 列出流水线 | `project_id` |
| `trigger_pipeline` | 触发流水线 | `project_id, ref="main"` |
| `get_pipeline_jobs` | 获取流水线作业 | `project_id, pipeline_id` |
| `retry_job` | 重试失败作业 | `project_id, job_id` |
| `push_file` | 创建/更新文件 | `project_id, path, content, message` |
| `list_branches` | 列出分支 | `project_id` |
| `create_branch` | 创建分支 | `project_id, branch, ref="main"` |
| `list_members` | 列出项目成员 | `project_id` |
| `add_member` | 添加成员 | `project_id, user_id, access_level=30` |
---
### Docker 工具 — 26 个工具
完整的 Docker 控制 — 镜像、容器、网络、卷、Compose。
```python
from npmai_agents import DockerTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `build_image` | 从 Dockerfile 构建镜像 | `context_path, tag, dockerfile="Dockerfile"` |
| `push_image` | 推送到镜像仓库 | `tag` |
| `pull_image` | 从镜像仓库拉取 | `image` |
| `tag_image` | 为镜像添加标签 | `source, target` |
| `remove_image` | 删除镜像 | `image, force=False` |
| `list_images` | 列出本地镜像 | — |
| `run_container` | 运行容器 | `image, name="", ports={}, env={}, volumes={}` |
| `stop_container` | 停止容器 | `name` |
| `start_container` | 启动停止的容器 | `name` |
| `remove_container` | 删除容器 | `name, force=False` |
| `exec_in_container` | 在容器中运行命令 | `name, command` |
| `get_logs` | 获取容器日志 | `name, tail=100` |
| `list_containers` | 列出容器 | `all=False` |
| `inspect_container` | 容器详细信息 | `name` |
| `create_network` | 创建网络 | `name, driver="bridge"` |
| `list_networks` | 列出网络 | — |
| `remove_network` | 删除网络 | `name` |
| `create_volume` | 创建卷 | `name` |
| `list_volumes` | 列出卷 | — |
| `remove_volume` | 删除卷 | `name, force=False` |
| `compose_up` | docker-compose up | `path, detach=True` |
| `compose_down` | docker-compose down | `path` |
| `compose_logs` | 查看 compose 日志 | `path, service=""` |
| `compose_ps` | 列出 compose 服务 | `path` |
| `login` | 登录镜像仓库 | `username, password, registry=""` |
| `system_prune` | 删除未使用的资源 | `force=False` |
```python
DockerTool.build_image("/home/sonu/app", tag="npmai-app:1.0.0")
DockerTool.run_container("npmai-app:1.0.0", name="npmai", ports={"8080": "80"}, env={"DEBUG": "false"})
DockerTool.exec_in_container("npmai", "python manage.py migrate")
DockerTool.get_logs("npmai", tail=50)
DockerTool.compose_up("/home/sonu/app")
```
---
### 包管理器工具 — 22 个工具
pip、npm、yarn、cargo、go — 全部在一个类中。
```python
from npmai_agents import PackageManagerTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `pip_install` | 安装 Python 包 | `package, version=""` |
| `pip_uninstall` | 卸载包 | `package` |
| `pip_list` | 列出已安装包 | — |
| `pip_show` | 显示包信息 | `package` |
| `pip_freeze` | 导出需求 | `output_file=""` |
| `npm_install` | npm 安装 | `package="", save_dev=False` |
| `npm_uninstall` | npm 卸载 | `package` |
| `npm_run` | 运行 npm 脚本 | `script, cwd="."` |
| `npm_build` | npm 构建 | `cwd="."` |
| `npm_publish` | npm 发布 | `cwd="."` |
| `npm_list` | 列出 npm 包 | `cwd="."` |
| `npm_update` | 更新包 | `cwd="."` |
| `npm_audit` | 安全审计 | `cwd="."` |
| `yarn_install` | yarn 安装 | `cwd="."` |
| `yarn_add` | 添加包 | `package, dev=False, cwd="."` |
| `yarn_remove` | 删除包 | `package, cwd="."` |
| `cargo_build` | 构建 Rust 项目 | `cwd=".", release=False` |
| `cargo_test` | 运行 Rust 测试 | `cwd="."` |
| `cargo_run` | 运行 Rust 二进制文件 | `cwd="."` |
| `go_build` | 构建 Go 项目 | `cwd="."` |
| `go_test` | 运行 Go 测试 | `cwd="."` |
| `go_get` | 获取 Go 包 | `package` |
---
### VSCode 工具 — 13 个工具
以编程方式控制 VS Code。
```python
from npmai_agents import VSCodeTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `open_file` | 在 VS Code 中打开文件 | `file_path` |
| `open_folder` | 打开文件夹 | `folder_path` |
| `install_extension` | 安装扩展 | `extension_id` |
| `uninstall_extension` | 卸载扩展 | `extension_id` |
| `list_extensions` | 列出已安装扩展 | — |
| `run_task` | 运行定义的任务 | `task_name, cwd="."` |
| `open_terminal` | 打开集成终端 | — |
| `apply_settings` | 应用设置 JSON | `settings: dict` |
| `get_settings` | 获取当前设置 | — |
| `format_file` | 格式化文件 | `file_path` |
| `lint_workspace` | 校验工作区 | `cwd="."` |
| `create_workspace` | 创建 .code-workspace | `name, folders: list` |
| `open_workspace` | 打开工作区文件 | `workspace_path` |
---
### 终端工具 — 15 个工具
Shell 执行、环境变量、进程管理。
```python
from npmai_agents import TerminalTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `run` | 执行 Shell 命令 | `command, cwd=".", timeout=60` |
| `run_interactive` | 运行交互式命令 | `command, cwd="."` |
| `run_script` | 执行脚本文件 | `script_path, interpreter="bash"` |
| `run_in_new_terminal` | 打开新的终端窗口 | `command` |
| `set_env_var` | 设置环境变量 | `key, value` |
| `get_env_var` | 获取环境变量 | `key` |
| `list_env_vars` | 列出所有环境变量 | — |
| `source_file` | 导入环境文件 | `file_path` |
| `which` | 查找命令路径 | `command` |
| `is_installed` | 检查工具是否安装 | `command` |
| `install_via_package_manager` | 自动安装工具 | `package` |
| `create_alias` | 创建 Shell 别名 | `name, command` |
| `list_processes` | 列出运行进程 | `filter=""` |
| `kill_process` | 按名称/PID 杀死进程 | `target` |
| `get_process_info` | 获取进程详细信息 | `pid` |
---
### Makefile 工具 — 4 个工具
```python
from npmai_agents import MakefileTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `run_target` | 运行 make 目标 | `target, cwd="."` |
| `list_targets` | 列出可用目标 | `cwd="."` |
| `create_makefile` | 创建新的 Makefile | `path, targets: dict` |
| `add_target` | 添加目标到 Makefile | `path, name, commands: list, deps=[]` |
---
### CMake 工具 — 5 个工具
```python
from npmai_agents import CMakeTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `configure` | 运行 cmake 配置 | `source_dir, build_dir, options={}` |
| `build` | 构建项目 | `build_dir, target="", jobs=4` |
| `install` | 安装构建 | `build_dir, prefix=""` |
| `clean` | 清理构建目录 | `build_dir` |
| `run_ctest` | 运行测试 | `build_dir, verbose=False` |
---
### 调试工具 — 6 个工具
```python
from npmai_agents import DebuggerTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `run_python_with_pdb` | 使用 pdb 调试器运行 | `script_path, breakpoints=[]` |
| `analyze_traceback` | 解析和解释回溯信息 | `traceback_text` |
| `profile_script` | 性能分析脚本 | `script_path, output=""` |
| `memory_profile` | 内存使用情况分析 | `script_path` |
| `find_deadlocks` | 检测线程死锁 | `pid` |
| `strace_process` | 跟踪系统调用 | `pid, output=""` |
---
## ◈ 商业 & 支付 — 152 个工具
---
### Stripe 工具 — 29 个工具
完整的 Stripe 支付 — 客户、意图、订阅、发票、付款。
```python
from npmai_agents import StripeTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `create_customer` | 创建客户 | `email, name, phone=""` |
| `get_customer` | 获取客户 | `customer_id` |
| `update_customer` | 更新客户 | `customer_id, **kwargs` |
| `list_customers` | 列出客户 | `limit=10, email=""` |
| `delete_customer` | 删除客户 | `customer_id` |
| `create_payment_intent` | 创建支付意图 | `amount, currency="inr", customer_id=""` |
| `confirm_payment` | 确认支付意图 | `payment_intent_id, payment_method` |
| `create_charge` | 创建收费 | `amount, currency, source, description=""` |
| `capture_charge` | 捕获授权收费 | `charge_id` |
| `refund_charge` | 退款 | `charge_id, amount=None` |
| `list_charges` | 列出收费 | `limit=10, customer_id=""` |
| `create_subscription` | 创建订阅 | `customer_id, price_id` |
| `cancel_subscription` | 取消订阅 | `subscription_id` |
| `update_subscription` | 更新订阅 | `subscription_id, **kwargs` |
| `list_subscriptions` | 列出订阅 | `customer_id=""` |
| `create_product` | 创建产品 | `name, description=""` |
| `create_price` | 创建价格 | `product_id, amount, currency, interval=""` |
| `create_invoice` | 创建发票 | `customer_id, auto_advance=True` |
| `finalize_invoice` | 确定发票 | `invoice_id` |
| `pay_invoice` | 支付发票 | `invoice_id` |
| `list_invoices` | 列出发票 | `customer_id=""` |
| `send_invoice_email` | 发送发票邮件 | `invoice_path, to_email, subject=""` |
| `create_coupon` | 创建优惠券 | `percent_off, duration="once"` |
| `apply_coupon` | 将优惠券应用于客户 | `customer_id, co` |
| `create_payment_link` | 创建支付链接 | `price_id, quantity=1` |
| `list_payment_methods` | 列出保存的支付方式 | `customer_id, type="card"` |
| `get_balance` | 获取账户余额 | — |
| `list_transactions` | 列出余额交易 | `limit=10` |
| `create_payout` | 创建付款 | `amount, currency="inr"` |
```python
cid = StripeTool.create_customer(email="sonu@npmai.ai", name="Sonu Kumar")["id"]
StripeTool.create_subscription(customer_id=cid, price_id="price_xxxxx")
inv = StripeTool.create_invoice(customer_id=cid)["id"]
StripeTool.finalize_invoice(invoice_id=inv)
StripeTool.pay_invoice(invoice_id=inv)
StripeTool.create_payout(amount=50000, currency="inr")
```
---
### Razorpay 工具 — 18 个工具
印度支付网关 — 订单、捕获、退款、订阅、二维码。
```python
from npmai_agents import RazorpayTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `create_order` | 创建支付订单 | `amount, currency="INR", notes={}` |
| `get_order` | 获取订单详情 | `order_id` |
| `list_orders` | 列出订单 | `count=10` |
| `fetch_payment` | 获取支付详情 | `payment_id` |
| `capture_payment` | 捕获支付 | `payment_id, amount` |
| `refund_payment` | 退款支付 | `payment_id, amount=None` |
| `list_payments` | 列出支付 | `count=10` |
| `create_refund` | 创建退款 | `payment_id, amount, notes={}` |
| `create_customer` | 创建客户 | `name, email, contact` |
| `get_customer` | 获取客户 | `customer_id` |
| `create_subscription` | 创建订阅 | `plan_id, customer_id, total_count` |
| `create_plan` | 创建计费计划 | `period, interval, name, amount, currency="INR"` |
| `list_plans` | 列出计划 | `count=10` |
| `create_payment_link` | 创建支付链接 | `amount, currency="INR", description=""` |
| `list_payment_links` | 列出支付链接 | `count=10` |
| `create_qr_code` | 创建支付二维码 | `type="upi_qr", name="", description=""` |
| `get_settlements` | 获取结算信息 | — |
| `get_settlement_transactions` | 获取结算交易信息 | `settlement_id` |
---
### Shopify 工具 — 25 个工具
完整的 Shopify 商店 — 产品、订单、客户、库存、折扣。
```python
from npmai_agents import ShopifyTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `list_products` | 列出产品 | `limit=50` |
| `get_product` | 获取产品 | `product_id` |
| `create_product` | 创建产品 | `title, body_html="", vendor="", product_type=""` |
| `update_product` | 更新产品 | `product_id, **kwargs` |
| `delete_product` | 删除产品 | `product_id` |
| `list_variants` | 列出产品变体 | `product_id` |
| `update_variant` | 更新变体 | `variant_id, **kwargs` |
| `list_orders` | 列出订单 | `status="any", limit=50` |
| `get_order` | 获取订单 | `order_id` |
| `update_order` | 更新订单 | `order_id, **kwargs` |
| `cancel_order` | 订单取消 | `order_id, reason=""` |
| `fulfill_order` | 订单履约 | `order_id, tracking_number=""` |
| `list_customers` | 列出客户 | `limit=50` |
| `get_customer` | 获取客户 | `customer_id` |
| `create_customer` | 创建客户 | `first_name, last_name, email` |
| `search_customers` | 搜索客户 | `query` |
| `list_customer_orders` | 获取客户订单 | `customer_id` |
| `get_inventory_levels` | 获取库存 | `location_id=""` |
| `adjust_inventory` | 调整库存水平 | `inventory_item_id, location_id, adjustment` |
| `list_collections` | 列出集合 | — |
| `create_collection` | 创建集合 | `title, body_html=""` |
| `create_discount` | 创建折扣码 | `code, value, value_type="percentage"` |
| `get_shop_info` | 获取商店信息 | — |
| `list_locations` | 列出商店位置 | — |
| `get_analytics` | 获取销售分析 | `period="day"` |
---
### Invoice 工具 — 8 个工具
```python
from npmai_agents import InvoiceTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `create_invoice` | 生成 PDF 发票 | `client, items: list, output_path` |
| `create_quote` | 生成报价 | `client, items: list, output_path` |
| `create_receipt` | 生成收据 | `client, items: list, output_path` |
| `create_purchase_order` | 生成采购订单 | `vendor, items: list, output_path` |
| `send_invoice_email` | 发送发票邮件 | `invoice_path, to_email, subject=""` |
| `batch_create_invoices` | 批量生成发票 | `data: list, output_dir` |
| `extract_invoice_data` | 从图像/PDF 中提取发票信息 | `file_path` |
| `create_recurring_invoice` | 设置循环发票 | `client, items, interval="monthly"` |
---
### Accounting 工具 — 10 个工具
```python
from npmai_agents import AccountingTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `calculate_gst` | 计算 GST | `amount, rate=18, inclusive=False` |
| `calculate_vat` | 计算 VAT | `amount, rate, inclusive=False` |
| `generate_profit_loss` | 生成损益表 | `revenue: list, expenses: list, period=""` |
| `generate_balance_sheet` | 生成资产负债表 | `assets: dict, liabilities: dict` |
| `generate_cash_flow` | 生成现金流量表 | `operations: list, investing: list, financing: list` |
| `depreciation_schedule` | 资产折旧 | `asset_cost, salvage, life, method="straight_line"` |
| `currency_convert` | 货币兑换 | `amount, from_currency, to_currency` |
| `get_exchange_rates` | 获取当前汇率 | `base="INR"` |
| `track_expenses` | 记录支出 | `amount, category, description, date=""` |
| `calculate_tax_liability` | 计算税收负债 | `income, deductions: dict, regime="new"` |
---
### CRMTool — 18
本地 SQLite CRM — 联系人,交易,流程,活动,报告。
```python
from npmai_agents import CRMTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `add_contact` | 添加联系人 | `name, email, phone="", company=""` |
| `update_contact` | 更新联系人 | `contact_id, **kwargs` |
| `delete_contact` | 删除联系人 | `contact_id` |
| `list_contacts` | 列出所有联系人 | `search=""` |
| `search_contacts` | 搜索联系人 | `query` |
| `import_contacts_csv` | 从 CSV 导入 | `csv_path` |
| `export_contacts` | 导出到 CSV | `output_path` |
| `merge_duplicate_contacts` | 合并重复联系人 | `contact_id_1, contact_id_2` |
| `add_deal` | 添加交易到流程 | `title, value, contact_id, stage="lead"` |
| `update_deal` | 更新交易 | `deal_id, **kwargs` |
| `close_deal` | 标记交易已关闭/赢得 | `deal_id, won=True` |
| `list_deals` | 列出所有交易 | `stage=""` |
| `get_pipeline_value` | 总交易价值 | `stage=""` |
| `add_activity` | 记录活动 | `contact_id, type, notes=""` |
| `list_activities` | 列出活动 | `contact_id=""` |
| `set_reminder` | 设置跟进提醒 | `contact_id, date, message` |
| `generate_sales_report` | 销售总结 | `period="month"` |
| `get_conversion_rate` | 潜在客户转化率 | `period="month"` |
---
### EmailMarketingTool — 13
```python
from npmai_agents import EmailMarketingTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `create_campaign` | 创建电子邮件活动 | `name, subject, list_id, template_id` |
| `schedule_campaign` | 安排活动 | `campaign_id, send_time` |
| `send_campaign_now` | 立即发送 | `campaign_id` |
| `create_list` | 创建订阅者列表 | `name` |
| `add_subscriber` | 添加订阅者 | `list_id, email, name=""` |
| `remove_subscriber` | 删除订阅者 | `list_id, email` |
| `import_subscribers` | 批量导入 | `list_id, csv_path` |
| `get_campaign_stats` | 获取活动指标 | `campaign_id` |
| `get_list_stats` | 获取列表统计 | `list_id` |
| `create_automation` | 创建电子邮件自动化 | `name, trigger, emails: list` |
| `create_template` | 创建电子邮件模板 | `name, html_content` |
| `unsubscribe` | 取消订阅电子邮件 | `email` |
| `get_unsubscribes` | 获取取消订阅列表 | `list_id` |
---
### AnalyticsTool — 9
```python
from npmai_agents import AnalyticsTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `connect_google_analytics` | 连接 GA4 | `property_id, credentials_path` |
| `get_sessions` | 获取会话数据 | `start_date, end_date` |
| `get_top_pages` | 浏览量最高的页面 | `start_date, end_date, limit=10` |
| `get_traffic_sources` | 流量来源分析 | `start_date, end_date` |
| `get_conversions` | 转换事件 | `start_date, end_date, event=""` |
| `get_realtime_users` | 实时活跃用户 | — |
| `create_custom_report` | 自定义维度报告 | `dimensions: list, metrics: list, date_range` |
| `generate_weekly_report` | 自动周报 | `output_path=""` |
| `track_event` | 跟踪自定义事件 | `event_name, params={}` |
---
### InventoryTool — 12
```python
from npmai_agents import InventoryTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `add_product` | 添加产品到库存 | `name, sku, quantity, cost, price` |
| `update_stock` | 更新库存水平 | `sku, quantity, operation="set"` |
| `get_stock_level` | 获取 SKU 库存 | `sku` |
| `list_low_stock` | 低于阈值的商品 | `threshold=10` |
| `list_out_of_stock` | 缺货商品 | — |
| `get_inventory_value` | 总库存价值 | — |
| `record_sale` | 记录销售 | `sku, quantity, price` |
| `record_purchase` | 记录采购 | `sku, quantity, cost` |
| `generate_stock_report` | 完整的库存报告 | `output_path=""` |
| `forecast_demand` | 需求预测 | `sku, days_ahead=30` |
| `export_inventory` | 导出到 CSV/Excel | `output_path` |
| `import_inventory` | 从 CSV 导入 | `csv_path` |
---
### ContractTool — 10
```python
from npmai_agents import ContractTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `create_nda` | 生成 NDA | `party_1, party_2, duration="1 year", output_path=""` |
| `create_service_agreement` | 服务协议 | `provider, client, services: list, rate, output_path=""` |
| `create_employment_contract` | 雇佣合同 | `employee, employer, role, salary, output_path=""` |
| `fill_template` | 填写合同模板 | `template_path, variables: dict, output_path` |
| `extract_key_terms` | AI 提取关键条款 | `contract_path` |
| `summarize_contract` | AI 总结合同 | `contract_path, max_words=300` |
| `check_contract_dates` | 检查到期日期 | `contract_path` |
| `compare_contracts` | 比较两个合同 | `path_1, path_2` |
| `add_signature_field` | 添加签名字段 | `contract_path, page, x, y` |
| `verify_signature` | 验证数字签名 | `contract_path` |
---
## ◈ 云与 DevOps — 149
---
### AWSS3Tool — 16
```python
from npmai_agents import AWSS3Tool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `create_bucket` | 创建 S3 存储桶 | `bucket_name, region="ap-south-1"` |
| `delete_bucket` | 删除存储桶 | `bucket_name` |
| `upload_file` | 上传文件 | `bucket, local_path, s3_key=""` |
| `upload_folder` | 上传目录 | `bucket, local_dir, s3_prefix=""` |
| `download_file` | 下载文件 | `bucket, s3_key, local_path` |
| `download_folder` | 下载前缀 | `bucket, s3_prefix, local_dir` |
| `list_objects` | 列出对象 | `bucket, prefix=""` |
| `delete_object` | 删除对象 | `bucket, s3_key` |
| `copy_object` | 复制对象 | `src_bucket, src_key, dst_bucket, dst_key` |
| `get_presigned_url` | 生成预签名 URL | `bucket, s3_key, expires=3600` |
| `set_bucket_policy` | 设置存储桶策略 | `bucket, policy: dict` |
| `enable_static_website` | 启用静态网站托管 | `bucket, index="index.html"` |
| `sync_folder` | 同步本地 ↔ S3 | `bucket, local_dir, s3_prefix=""` |
| `get_object_metadata` | 获取对象元数据 | `bucket, s3_key` |
| `list_buckets` | 列出所有存储桶 | — |
| `get_bucket_size` | 获取存储桶总大小 | `bucket` |
---
### AWSLambdaTool — 12
```python
from npmai_agents import AWSLambdaTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `create_function` | 创建 Lambda 函数 | `name, runtime, handler, zip_path, role_arn` |
| `update_function_code` | 更新函数代码 | `name, zip_path` |
| `update_function_config` | 更新配置 | `name, **kwargs` |
| `invoke_function` | 调用函数 | `name, payload={}` |
| `delete_function` | 删除函数 | `name` |
| `list_functions` | 列出所有函数 | — |
| `get_function` | 获取函数详情 | `name` |
| `add_layer` | 附加 Lambda 层 | `function_name, layer_arn` |
| `create_trigger_s3` | 添加 S3 触发器 | `function_name, bucket, events=["s3:ObjectCreated:*"]` |
| `create_trigger_api_gateway` | 添加 API Gateway 触发器 | `function_name, api_id` |
| `get_logs` | 获取 CloudWatch 日志 | `function_name, limit=100` |
| `list_versions` | 列出函数版本 | `function_name` |
---
### AWSECSTool — 11
```python
from npmai_agents import AWSECSTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `create_cluster` | 创建 ECS 集群 | `name` |
| `delete_cluster` | 删除集群 | `name` |
| `register_task_definition` | 注册任务定义 | `family, containers: list, cpu="256", memory="512"` |
| `run_task` | 运行任务 | `cluster, task_definition, launch_type="FARGATE"` |
| `stop_task` | 停止任务 | `cluster, task_arn` |
| `list_tasks` | 列出运行中的任务 | `cluster, status="RUNNING"` |
| `create_service` | 创建服务 | `cluster, name, task_def, desired_count=1` |
| `update_service` | 更新服务 | `cluster, name, desired_count=None, task_def=""` |
| `delete_service` | 删除服务 | `cluster, name` |
| `describe_tasks` | 描述任务 | `cluster, task_arns: list` |
| `get_task_logs` | 获取任务日志 | `cluster, task_arn` |
---
### CloudflareTool — 20
```python
from npmai_agents import CloudflareTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `list_zones` | 列出区域 | — |
| `get_zone` | 获取区域详情 | `zone_id` |
| `create_dns_record` | 创建 DNS 记录 | `zone_id, type, name, content, ttl=1` |
| `update_dns_record` | 更新 DNS 记录 | `zone_id, record_id, **kwargs` |
| `delete_dns_record` | 删除 DNS 记录 | `zone_id, record_id` |
| `list_dns_records` | 列出 DNS 记录 | `zone_id, type=""` |
| `purge_cache` | 清除所有缓存 | `zone_id, urls=[]` |
| `get_analytics` | 区域分析 | `zone_id, period="-10080"` |
| `create_worker` | 创建 Worker | `name, script` |
| `update_worker` | 更新 Worker | `name, script` |
| `delete_worker` | 删除 Worker | `name` |
| `list_workers` | 列出 Worker | — |
| `set_worker_route` | 设置 Worker 路由 | `zone_id, pattern, worker_name` |
| `create_kv_namespace` | 创建 KV 命名空间 | `title` |
| `write_kv` | 写入 KV 值 | `namespace_id, key, value` |
| `read_kv` | 读取 KV 值 | `namespace_id, key` |
| `delete_kv` | 删除 KV 键 | `namespace_id, key` |
| `list_kv` | 列出 KV 键 | `namespace_id` |
| `get_firewall_rules` | 获取防火墙规则 | `zone_id` |
| `create_firewall_rule` | 创建防火墙规则 | `zone_id, expression, action="block"` |
---
### VercelTool — 13 · NetlifyTool — 13 · RailwayTool — 10
```python
from npmai_agents import VercelTool, NetlifyTool, RailwayTool
```
**VercelTool: `deploy` · `list_deployments` · `get_deployment` · `delete_deployment` · `list_projects` · `create_project` · `delete_project` · `set_env_var` · `list_env_vars` · `get_deployment_logs` · `rollback` · `add_domain` · `list_domains`
**NetlifyTool: `list_sites` · `create_site` · `delete_site` · `deploy_folder` · `list_deploys` · `rollback_deploy` · `lock_deploy` · `set_env_var` · `list_env_vars` · `delete_env_var` · `add_domain` · `list_forms` · `get_form_submissions`
**RailwayTool: `deploy` · `list_projects` · `create_project` · `list_services` · `deploy_service` · `restart_service` · `set_env_var` · `list_env_vars` · `get_logs` · `get_deployments`
---
### KubernetesTool — 24
```python
from npmai_agents import KubernetesTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `apply` | 应用 YAML 清单 | `manifest_path` |
| `delete_resource` | 删除资源 | `resource_type, name, namespace="default"` |
| `get_pods` | 列出 Pod | `namespace="default", label=""` |
| `describe_pod` | 描述 Pod | `name, namespace="default"` |
| `get_pod_logs` | 获取 Pod 日志 | `name, namespace="default", tail=100` |
| `exec_in_pod` | 在 Pod 中执行 | `name, command, namespace="default"` |
| `get_deployments` | 列出部署 | `namespace="default"` |
| `scale_deployment` | 部署扩缩 | `name, replicas, namespace="default"` |
| `rollout_restart` | 部署重启 | `name, namespace="default"` |
| `rollout_status` | 检查部署状态 | `name, namespace="default"` |
| `get_top_pages` | 浏览量最高的页面 | `name, namespace="default"` |
| `rollout_status` | 检查部署状态 | `name, namespace="default"` |
| `get_services` | 列出服务 | `namespace="default"` |
| `port_forward` | 端口转发 | `resource, local_port, remote_port, namespace="default"` |
| `get_nodes` | 列出节点 | — |
| `cordon_node` | 标记节点 | `node_name` |
| `drain_node` | 排空节点 | `node_name` |
| `apply_secret` | 创建/更新密钥 | `name, data: dict, namespace="default"` |
| `get_configmap` | 获取 ConfigMap | `name, namespace="default"` |
| `create_namespace` | 创建命名空间 | `name` |
| `list_namespaces` | 列出命名空间 | — |
| `get_resource_usage` | 获取资源使用情况 | `namespace="default"` |
| `helm_install` | 安装 Helm 图表 | `release_name, chart, values={}` |
| `helm_upgrade` | 升级 Helm 图表 | `release_name, chart, values={}` |
| `helm_uninstall` | 卸载 Helm 图表 | `release_name` |
| `helm_list` | 列出 Helm 版本 | — |
---
### TerraformTool — 16
```python
from npmai_agents import TerraformTool
```
**TerraformTool: `init` · `plan` · `apply` · `destroy` · `validate` · `fmt` · `show` · `output` · `state_list` · `state_show` · `state_rm` · `import_resource` · `graph` · `workspace_list` · `workspace_new` · `workspace_select`
---
### MonitoringTool — 14
```python
from npmai_agents import MonitoringTool
```
**MonitoringTool: `get_cpu_usage` · `get_memory_info` · `get_disk_usage` · `get_network_io` · `get_process_list` · `kill_process` · `get_gpu_info` · `watch_file_changes` · `get_open_ports` · `check_service_health` · `send_alert` · `get_system_info` · `tail_log_file` · `parse_log_file`
---
## ◈ Communication — 95
---
### TwilioTool — 12
```python
from npmai_agents import TwilioTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `send_sms` | 发送短信 | `to, body, from_=""` |
| `send_bulk_sms` | 批量发送短信 | `numbers: list, body` |
| `make_call` | 语音通话 | `to, message, from_=""` |
| `get_call_status` | 检查通话状态 | `call_sid` |
| `send_whatsapp` | 发送 WhatsApp 消息 | `to, body` |
| `send_whatsapp_template` | 模板 WhatsApp 消息 | `to, template_sid, variables: list` |
| `get_message_status` | 检查消息状态 | `message_sid` |
| `list_messages` | 列出消息 | `limit=20` |
| `verify_phone` | 发送验证码 | `to, channel="sms"` |
| `check_verification` | 检查验证码 | `to, code` |
| `create_subaccount` | 创建子账户 | `friendly_name` |
| `get_account_balance` | 获取余额 | — |
---
### SendGridTool — 14
```python
from npmai_agents import SendGridTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `send_email` | 发送交易邮件 | `to, subject, body, from_email=""` |
| `send_bulk` | 批量发送邮件 | `recipients: list, subject, body` |
| `send_with_template` | 模板邮件 | `to, template_id, data: dict` |
| `create_template` | 创建邮件模板 | `name, html_content` |
| `update_template` | 更新模板 | `template_id, html_content` |
| `list_templates` | 列出模板 | — |
| `create_contact_list` | 创建联系人列表 | `name` |
| `add_contacts` | 添加联系人到列表 | `list_id, contacts: list` |
| `create_campaign` | 创建活动 | `title, subject, list_ids: list, template_id` |
| `schedule_campaign` | 安排发送 | `campaign_id, send_at` |
| `get_stats` | 邮件统计 | `start_date, end_date` |
| `get_bounces` | 列出退信邮件 | — |
| `delete_bounce` | 从退信列表中移除 | `email` |
| `get_spam_reports` | 列出垃圾邮件报告 | — |
---
### CalendarTool — 11
```python
from npmai_agents import CalendarTool
```
| 方法 | 用途 | 关键参数 |
|---|---|---|
| `list_events` | 列出即将到来的事件 | `max_results=10, calendar_id="primary"` |
| `create_event` | 创建事件 | `summary, start, end, description="", attendees=[]` |
| `update_event` | 更新事件 | `event_id, **kwargs` |
| `delete_event` | 删除事件 | `event_id, calendar_id="primary"` |
| `quick_add_event` | 自然语言添加 | `text, calendar_id="primary"` |
| `list_calendars` | 列出所有日历 | — |
| `create_calendar` | 创建新日历 | `summary, timezone="Asia/Kolkata"` |
| `find_free_slots` | 查找空闲时间 | `duration_minutes=60, days_ahead=7, working_hours=(9,18)` |
| `send_invite` | 发送事件邀请 | `event_id, email` |
| `sync_to_local` | 导出到本地 ICS | `output_path, max_results=100` |
| `import_ical` | 导入 ICS 文件 | `ical_path, calendar_id="primary"` |
---
### ZoomTool — 10 · MicrosoftTeamsTool — 5 · TwilioTool (above) · PushNotificationTool — 7 · RSSFeedTool — 9 · WebhookTool — 8 · ChatOpsAutomationTool — 9 · SMTPAdvancedTool — 10
```python
from npmai_agents import ZoomTool, MicrosoftTeamsTool, PushNotificationTool
from npmai_agents import RSSFeedTool, WebhookTool, ChatOpsAutomationTool, SMTPAdvancedTool
```
**ZoomTool:** `create_meeting` · `list_meetings` · `get_meeting` · `update_meeting` · `delete_meeting` · `get_meeting_participants` · `get_recording` · `list_recordings` · `create_webinar` · `get_registrants`
**MicrosoftTeamsTool:** `send_message` · `send_adaptive_card` · `send_file_notification` · `create_channel_message_with_mention` · `send_approval_request`
**PushNotificationTool:** `send_fcm` · `send_fcm_bulk` · `send_fcm_topic` · `send_apns` · `send_web_push` · `send_pushbullet` · `send_pushover`
**RSSFeedTool:** `parse_feed` · `monitor_feed` · `compare_feeds` · `get_new_items` · `create_rss_feed` · `aggregate_feeds` · `search_in_feed` · `export_feed_items` · `subscribe_and_notify`
**WebhookTool:** `start_webhook_server` · `verify_signature` · `register_webhook` · `list_registered_webhooks` · `test_webhook` · `replay_webhook` · `create_webhook_proxy` · `inspect_webhook_payload`
**ChatOpsAutomationTool:** `route_alert` · `create_incident` · `post_deployment_notification` · `send_daily_standup_reminder` · `collect_standup_responses` · `create_approval_workflow` · `check_approval_status` · `broadcast_announcement` · `schedule_message`
**SMTPAdvancedTool:** `send_html_email` · `send_template_email` · `monitor_inbox` · `search_emails` · `download_attachments` · `auto_reply` · `forward_emails` · `mark_as_read` · `delete_emails` · `create_filter_rule`
---
## ◈ Creative & Design — 97
---
### FigmaTool — 13
```python
from npmai_agents import FigmaTool
```
| 方法 | 目的 | 关键参数 |
|---|---|---|
| `get_file` | 获取 Figma 文件 | `file_key` |
| `get_node` | 获取特定节点 | `file_key, node_id` |
| `list_files` | 列出项目文件 | `project_id` |
| `export_asset` | 导出资产 | `file_key, node_id, format="PNG", scale=1` |
| `export_all_assets` | 导出所有资产 | `file_key, output_dir, format="PNG"` |
| `get_components` | 获取组件 | `file_key` |
| `get_styles` | 获取样式 | `file_key` |
| `get_comments` | 获取评论 | `file_key` |
| `post_comment` | 发布评论 | `file_key, message, x, y` |
| `create_webhook` | 创建 webhook | `team_id, event_type, endpoint` |
| `list_projects` | 列出团队项目 | `team_id` |
| `get_team_components` | 团队组件库 | `team_id` |
| `get_versions` | 文件版本历史 | `file_key` |
---
### DiagramTool — 10
```python
from npmai_agents import DiagramTool
```
| 方法 | 目的 | 关键参数 |
|---|---|---|
| `create_flowchart` | 从步骤创建流程图 | `steps: list, output_path` |
| `create_er_diagram` | ER 图 | `tables: dict, output_path` |
| `create_sequence_diagram` | 时序图 | `actors: list, messages: list, output_path` |
| `create_class_diagram` | UML 类图 | `classes: dict, output_path` |
| `create_network_diagram` | 网络拓扑 | `nodes: list, edges: list, output_path` |
| `create_gantt` | 甘特图 | `tasks: list, output_path` |
| `create_mindmap` | 思维导图 | `root, branches: dict, output_path` |
| `create_org_chart` | 组织结构图 | `structure: dict, output_path` |
| `render_mermaid` | 渲染 Mermaid 语法 | `mermaid_code, output_path` |
| `render_plantuml` | 渲染 PlantUML | `plantuml_code, output_path` |
---
### SVGTool — 10 · BlenderTool — 11 · CanvaTool — 9 · FontTool — 10 · ColorTool — 11 · IconTool — 7 · PrintTool — 8 · ThreeDTool — 8
```python
from npmai_agents import SVGTool, BlenderTool, CanvaTool, FontTool
from npmai_agents import ColorTool, IconTool, PrintTool, ThreeDTool
```
**SVGTool:** `create_svg` · `add_element` · `convert_to_png` · `convert_to_pdf` · `optimize` · `animate` · `batch_convert` · `create_icon_set` · `trace_bitmap` · `merge_svgs`
**BlenderTool:** `render_image` · `render_animation` · `import_obj` · `import_fbx` · `export_obj` · `export_fbx` · `export_gltf` · `convert_format` · `apply_material` · `batch_render` · `create_turntable_video`
**CanvaTool:** `list_designs` · `get_design` · `create_design` · `export_design` · `list_brand_kits` · `get_brand_kit` · `list_assets` · `upload_asset` · `create_from_template`
**FontTool:** `list_system_fonts` · `install_font` · `remove_font` · `render_text_image` · `create_text_animation_frames` · `generate_font_preview` · `convert_font` · `subset_font` · `get_font_info` · `pair_fonts_suggestion`
**ColorTool:** `generate_palette` · `extract_palette_from_image` · `convert_color` · `find_complementary` · `create_gradient` · `check_contrast_ratio` · `suggest_accessible_combination` · `create_color_wheel` · `generate_brand_palette` · `export_palette` · `analyze_image_colors`
**IconTool:** `generate_icon` · `create_app_icon_set` · `resize_icon` · `convert_ico` · `create_favicon_package` · `batch_convert_icons` · `add_badge`
**PrintTool:** `create_business_card` · `create_flyer` · `create_poster` · `create_brochure` · `create_certificate` · `create_label_sheet` · `create_letterhead` · `add_bleed_marks`
**ThreeDTool:** `view_model` · `get_model_info` · `convert_model` · `optimize_mesh` · `center_model` · `scale_model` · `merge_models` · `generate_thumbnail`
---
## ◈ 数据与研究 — 137
---
### DataAnalysisTool — 15
```python
from npmai_agents import DataAnalysisTool
```
| 方法 | 目的 | 关键参数 |
|---|---|---|
| `load` | 加载 CSV/Excel/JSON | `file_path` |
| `save` | 保存到文件 | `file_path, format="csv"` |
| `profile` | 统计概况 | — |
| `clean` | 自动数据清理 | `remove_nulls=True, remove_duplicates=True` |
| `transform` | 转换列 | `operations: dict` |
| `filter_data` | 过滤行 | `conditions: dict` |
| `merge_files` | 合并数据集 | `file_paths: list, on, how="inner"` |
| `pivot` | 数据透视表 | `index, columns, values, aggfunc="sum"` |
| `time_series_analysis` | 时间序列统计 | `date_col, value_col` |
| `correlation_matrix` | 相关性热图 | `output_path=""` |
| `outlier_detection` | 异常值检测 | `method="iqr"` |
| `feature_importance` | 特征重要性 | `target_col` |
| `cluster_data` | K-means 聚类 | `n_clusters=3, features: list` |
| `natural_language_query` | 普通话查询 | `question` |
| `auto_visualize` | 自动生成图表 | `out_dir=""` |
---
### VisualizationTool — 15
```python
from npmai_agents import VisualizationTool
```
| 方法 | 目的 | 关键参数 |
|---|---|---|
| `bar_chart` | 条形图 | `data, x, y, title="", output_path=""` |
| `line_chart` | 折线图 | `data, x, y, title="", output_path=""` |
| `scatter_plot` | 散点图 | `data, x, y, color="", output_path=""` |
| `pie_chart` | 饼图 | `data, labels, values, title="", output_path=""` |
| `heatmap` | 相关性热图 | `data, output_path=""` |
| `histogram` | 直方图 | `data, column, bins=20, output_path=""` |
| `box_plot` | 箱线图 | `data, columns: list, output_path=""` |
| `violin_plot` | 小提琴图 | `data, x, y, output_path=""` |
| `geographic_map` | 地图 | `data, location_col, value_col, output_path=""` |
| `create_dashboard` | 多图表仪表盘 | `charts: list, output_path` |
| `sankey_diagram` | 桑基图 | `source: list, target: list, value: list, output_path=""` |
| `treemap` | 树图 | `data, path: list, values, output_path=""` |
| `sunburst` | 旭日图 | `data, path: list, values, output_path=""` |
| `waterfall_chart` | 瀑布图 | `categories: list, values: list, output_path=""` |
| `candlestick_chart` | K 线图 | `data, output_path=""` |
---
### DatabaseTool — 22
```python
from npmai_agents import DatabaseTool
```
| 方法 | 目的 | 关键参数 |
|---|---|---|
| `connect_postgres` | 连接 PostgreSQL | `host, db, user, password, port=5432` |
| `execute_query` | 执行 SQL 查询 | `query, params=()` |
| `execute_transaction` | 执行事务 | `queries: list` |
| `backup_postgres` | 备份数据库 | `output_path` |
| `restore_postgres` | 恢复备份 | `backup_path` |
| `get_schema` | 获取数据库模式 | — |
| `connect_mysql` | 连接 MySQL | `host, db, user, password, port=3306` |
| `connect_mongodb` | 连接 MongoDB | `uri, db_name` |
| `mongo_find` | 查找文档 | `collection, query={}, limit=0` |
| `mongo_insert` | 插入文档 | `collection, data` |
| `mongo_update` | 更新文档 | `collection, query, update` |
| `mongo_delete` | 删除文档 | `collection, query` |
| `connect_redis` | 连接 Redis | `host="localhost", port=6379, db=0` |
| `redis_set` | 设置键值 | `key, value, expire=None` |
| `redis_get` | 获取键值 | `key` |
| `redis_hset` | 设置哈希字段 | `name, key, value` |
| `redis_hget` | 获取哈希字段 | `name, key` |
| `redis_lpush` | 推送到列表 | `name, *values` |
| `export_to_csv` | 导出查询结果到 CSV | `query, output_path` |
| `import_from_csv` | 从 CSV 导入到表格 | `csv_path, table_name` |
| `create_sqlite_db` | 创建 SQLite 数据库 | `db_path` |
| `query_sqlite` | 查询 SQLite | `db_path, query` |
---
### SearchResearchTool — 11 · FinancialDataTool — 14 · SocialMediaDataTool — 14 · WeatherGeoTool — 12 · TextAnalyticsTool — 14 · WebScrapingAdvancedTool — 12 · ReportGeneratorTool — 8
```python
from npmai_agents import SearchResearchTool, FinancialDataTool, SocialMediaDataTool
from npmai_agents import WeatherGeoTool, TextAnalyticsTool, WebScrapingAdvancedTool, ReportGeneratorTool
```
**SearchResearchTool:** `search_arxiv` · `get_arxiv_paper` · `search_pubmed` · `search_semantic_scholar` · `get_citations` · `search_wikipedia` · `get_wikipedia_page` · `search_google_scholar` · `search_news` · `get_trending_topics` · `search_patents`
**FinancialDataTool:** `get_stock_price` · `get_multiple_stocks` · `get_company_info` · `get_financial_statements` · `get_earnings_calendar` · `get_economic_indicators` · `get_crypto_price` · `get_crypto_info` · `get_forex_rate` · `get_commodity_prices` · `calculate_technical_indicators` · `screen_stocks` · `get_options_chain` · `portfolio_analysis`
**SocialMediaDataTool:** `get_twitter_user` · `get_twitter_timeline` · `search_twitter` · `get_twitter_trends` · `get_reddit_posts` · `search_reddit` · `get_reddit_comments` · `get_subreddit_info` · `get_youtube_video_info` · `get_youtube_channel_info` · `get_youtube_comments` · `search_youtube` · `get_instagram_profile` · `get_hackernews_top`
**WeatherGeoTool:** `get_current_weather` · `get_forecast` · `get_historical_weather` · `get_weather_alerts` · `geocode` · `reverse_geocode` · `get_timezone` · `calculate_distance` · `get_elevation` · `get_nearby_places` · `get_air_quality` · `get_uv_index`
**TextAnalyticsTool:** `sentiment_analysis` · `classify_text` · `extract_entities` · `extract_keywords` · `summarize` · `translate` · `detect_language` · `check_grammar` · `calculate_readability` · `topic_modeling` · `text_similarity` · `generate_embeddings` · `semantic_search` · `detect_plagiarism`
**WebScrapingAdvancedTool:** `scrape_with_js` · `scrape_paginated` · `scrape_login_protected` · `extract_structured_data` · `monitor_page_changes` · `bulk_scrape` · `extract_emails_phones` · `map_website_structure` · `take_full_screenshot` · `extract_all_links` · `download_all_images` · `fill_and_submit_form`
**ReportGeneratorTool:** `create_pdf_report` · `create_word_report` · `create_excel_report` · `create_presentation` · `generate_research_report` · `schedule_report` · `create_dashboard_report` · `generate_from_template`
---
## ◈ 媒体 & 音视频 — 123
---
### FFmpegTool — 32
```python
from npmai_agents import FFmpegTool
```
| 方法 | 目的 | 关键参数 |
|---|---|---|
| `trim` | 剪辑视频/音频 | `input, output, start, end` |
| `merge` | 合并文件 | `inputs: list, output` |
| `compress_video` | 压缩视频 | `input, output, crf=23` |
| `compress_audio` | 压缩音频 | `input, output, bitrate="128k"` |
| `convert` | 转换格式 | `input, output` |
| `extract_audio` | 提取音频轨 | `input, output` |
| `replace_audio` | 替换音频 | `video, audio, output` |
| `add_subtitles` | 烧录字幕 | `input, srt, output` |
| `extract_subtitles` | 提取字幕 | `input, output` |
| `resize` | 剪辑视频 | `input, output, x, y, width, height` |
| `crop` | 剪辑视频 | `input, output, x, y, width, height` |
| `add_watermark` | 添加水印 | `input, watermark, output, position="bottomright"` |
| `change_speed` | 改变播放速度 | `input, output, speed=2.0` |
| `reverse` | 反转视频 | `input, output` |
| `loop` | 循环视频 | `input, output, count=3` |
| `concatenate_with_transition` | 拼接视频并添加过渡 | `inputs: list, output, transition="fade"` |
| `extract_frames` | 提取帧 | `input, output_dir, fps=1` |
| `create_from_frames` | 从帧创建视频 | `frames_dir, output, fps=24` |
| `add_intro_outro` | 添加片头片尾 | `main, intro, outro, output` |
| `picture_in_picture` | 画中画 | `main, overlay, output, position="topright"` |
| `normalize_audio` | 标准化音频 | `input, output` |
| `denoise_audio` | 音频降噪 | `input, output` |
| `get_metadata` | 获取文件元数据 | `input` |
| `get_duration` | 获取时长 | `input` |
| `get_resolution` | 获取分辨率 | `input` |
| `create_thumbnail` | 生成缩略图 | `input, output, time="00:00:05"` |
| `create_gif` | 创建 GIF | `input, output, start=0, duration=5` |
| `split_by_duration` | 按时长分割 | `input, output_dir, segment_duration=60` |
| `add_text_overlay` | 添加文本叠加层 | `input, output, text, x, y` |
| `stabilize_video` | 视频稳定 | `input, output` |
| `color_grade` | 色彩分级 | `input, output, preset="cinematic"` |
| `create_slideshow` | 图片转视频 | `images_dir, output, duration_per_image=3` |
```python
FFmpegTool.trim("/home/sonu/raw.mp4", "trimmed.mp4", start=5, end=10)
FFmpegTool.create_gif("/home/sonu/demo.mp4", "demo.gif", start=5, duration=8)
FFmpegTool.add_subtitles("/home/sonu/video.mp4", "/home/sonu/subs.srt", "final.mp4")
FFmpegTool.split_by_duration("/home/sonu/lecture.mp4", "/home/sonu/parts", segment_duration=300)
```
---
### AudioTool — 15
```python
from npmai_agents import AudioTool
```
**AudioTool:** `convert` · `split` · `merge` · `normalize` · `change_pitch` · `change_tempo` · `remove_silence` · `apply_eq` · `fade_in_out` · `detect_bpm` · `get_waveform_data` · `record_microphone` · `play_audio` · `transcribe` · `translate_audio`
---
### YouTubeDownloaderTool — 9
```python
from npmai_agents import YouTubeDownloaderTool
```
**YouTubeDownloaderTool:** `download_video` · `download_audio` · `download_playlist` · `get_video_info` · `download_subtitles` · `get_available_formats` · `download_thumbnail` · `search_videos` · `get_channel_videos`
---
### ImageAdvancedTool — 20
```python
from npmai_agents import ImageAdvancedTool
```
**ImageAdvancedTool:** `batch_resize` · `batch_convert` · `create_collage` · `remove_background` · `replace_background` · `upscale` · `restore_old_photo` · `face_detect` · `blur_faces` · `add_border` · `add_shadow` · `create_gif_from_images` · `optimize_for_web` · `extract_dominant_colors` · `create_palette` · `compare_images` · `create_sprite_sheet` · `watermark_batch` · `convert_to_ico` · `create_favicon`
---
### ScreenRecorderTool — 7
```python
from npmai_agents import ScreenRecorderTool
```
**ScreenRecorderTool:** `screenshot` · `screenshot_all_monitors` · `record_screen` · `record_with_cursor` · `capture_window` · `list_windows` · `create_screencast_gif`
---
### TextToSpeechTool — 7
```python
from npmai_agents import TextToSpeechTool
```
**TextToSpeechTool:** `generate` · `list_voices` · `generate_ssml` · `clone_voice` · `generate_batch` · `add_background_music` · `translate_and_speak`
---
### VideoEditingTool — 10
```python
from npmai_agents import VideoEditingTool
```
**VideoEditingTool:** `auto_cut_silences` · `jump_cut` · `auto_color_correct` · `auto_denoise` · `create_highlight_reel` · `add_chapter_markers` · `export_for_platform` · `create_vertical_from_horizontal` · `batch_process` · `apply_lut`
---
### PodcastTool — 8
```python
from npmai_agents import PodcastTool
```
**PodcastTool:** `record_episode` · `edit_raw_recording` · `clean_audio` · `generate_transcript` · `generate_show_notes` · `create_chapters` · `export_to_formats` · `generate_rss_feed`
---
### StreamingTool — 6
```python
from npmai_agents import StreamingTool
```
**StreamingTool:** `stream_to_youtube` · `stream_to_twitch` · `stream_to_multiple` · `capture_stream` · `get_stream_info` · `download_live_stream`
---
### MediaMetadataTool — 9
```python
from npmai_agents import MediaMetadataTool
```
**MediaMetadataTool:** `read_metadata` · `write_metadata` · `bulk_rename_by_metadata` · `fix_dates` · `add_album_art` · `extract_album_art` · `generate_nfo` · `create_m3u_playlist` · `scan_folder`
---
## ◈ 生产力与项目管理 — 176
---
### GoogleWorkspaceTool — 21
```python
from npmai_agents import GoogleWorkspaceTool
```
| 方法 | 目的 | 关键参数 |
|---|---|---|
| `docs_create` | 创建 Google 文档 | `title, content=""` |
| `docs_get` | 获取文档内容 | `doc_id` |
| `docs_append` | 在文档中追加文本 | `doc_id, text` |
| `docs_replace_text` | 在文档中查找替换文本 | `doc_id, old, new` |
| `docs_export` | 导出文档 | `doc_id, format="pdf", output_path=""` |
| `sheets_create` | 创建电子表格 | `title` |
| `sheets_read` | 读取表格范围 | `sheet_id, range_` |
| `sheets_write` | 写入表格 | `sheet_id, range_, data: list` |
| `sheets_append` | 追加行 | `sheet_id, range_, data: list` |
| `sheets_clear` | 清除范围 | `sheet_id, range_` |
| `sheets_format_cells` | 格式化单元格 | `sheet_id, range_, format: dict` |
| `sheets_add_chart` | 在表格中添加图表 | `sheet_id, chart_type, data_range` |
| `drive_upload` | 上传到 Google Drive | `local_path, folder_id=""` |
| `drive_download` | 从 Google Drive 下载 | `file_id, output_path` |
| `drive_list` | 列出 Google Drive 文件 | `folder_id="", query=""` |
| `drive_create_folder` | 创建文件夹 | `name, parent_id=""` |
| `drive_share` | 分享文件 | `file_id, email, role="reader"` |
| `drive_move` | 移动文件 | `file_id, folder_id` |
| `forms_create` | 创建 Google 表单 | `title, questions: list` |
| `forms_get_responses` | 获取表单响应 | `form_id` |
| `forms_list` | 列出表单 | — |
---
### NotionAdvancedTool — 19
### LinearTool — 19
### AsanaTool — 19
### TrelloTool — 20
```python
from npmai_agents import NotionAdvancedTool, LinearTool, AsanaTool, TrelloTool
```
#### NotionAdvancedTool
- `search`
- `get_database`
- `query_database`
- `create_database`
- `add_database_item`
- `update_database_item`
- `delete_database_item`
- `create_page`
- `get_page`
- `update_page`
- `append_blocks`
- `get_blocks`
- `delete_block`
- `create_table`
- `create_kanban_view`
- `export_database_to_csv`
- `import_csv_to_database`
- `create_template`
- `duplicate_page`
#### LinearTool
- `list_issues`
- `get_issue`
- `create_issue`
- `update_issue`
- `close_issue`
- `delete_issue`
- `list_teams`
- `get_team`
- `list_projects`
- `create_project`
- `update_project`
- `list_members`
- `list_labels`
- `create_label`
- `list_cycles`
- `create_cycle`
- `add_issue_to_cycle`
- `get_comments`
- `add_comment`
#### AsanaTool
- `list_workspaces`
- `list_projects`
- `get_project`
- `create_project`
- `list_tasks`
- `get_task`
- `create_task`
- `update_task`
- `complete_task`
- `delete_task`
- `add_subtask`
- `list_subtasks`
- `add_comment`
- `list_comments`
- `list_sections`
- `create_section`
- `move_task_to_section`
- `list_tags`
- `add_tag_to_task`
#### TrelloTool
- `list_boards`
- `get_board`
- `create_board`
- `list_lists`
- `create_list`
- `archive_list`
- `list_cards`
- `get_card`
- `create_card`
- `update_card`
- `move_card`
- `archive_card`
- `add_checklist`
- `check_checklist_item`
- `add_comment`
- `add_attachment`
- `list_members`
- `add_member`
- `create_label`
- `add_label_to_card`
---
### ClickUpTool — 17
### TodoistTool — 17
### ObsidianTool — 15
### BookmarkManagerTool — 12
### TimeTrackingTool — 17
```python
from npmai_agents import ClickUpTool, TodoistTool, ObsidianTool, BookmarkManagerTool, TimeTrackingTool
```
#### ClickUpTool
- `list_spaces`
- `list_folders`
- `list_lists`
- `get_tasks`
- `get_task`
- `create_task`
- `update_task`
- `delete_task`
- `set_task_status`
- `add_comment`
- `list_comments`
- `create_checklist`
- `add_checklist_item`
- `track_time`
- `get_time_entries`
- `list_views`
- `get_view_tasks`
#### TodoistTool
- `get_projects`
- `add_project`
- `update_project`
- `delete_project`
- `get_tasks`
- `add_task`
- `update_task`
- `complete_task`
- `delete_task`
- `reopen_task`
- `get_comments`
- `add_comment`
- `get_labels`
- `add_label`
- `quick_add`
- `get_activity_log`
- `get_productivity_stats`
#### ObsidianTool
- `read_note`
- `create_note`
- `update_note`
- `delete_note`
- `search_notes`
- `list_notes`
- `get_backlinks`
- `get_outlinks`
- `add_tag`
- `remove_tag`
- `create_daily_note`
- `append_to_daily_note`
- `create_canvas`
- `get_graph_data`
- `sync_folder_to_vault`
#### BookmarkManagerTool
- `import_bookmarks`
- `export_bookmarks`
- `add_bookmark`
- `remove_bookmark`
- `search_bookmarks`
- `organize_by_domain`
- `check_broken_links`
- `archive_page`
- `generate_reading_list`
- `bulk_screenshot`
- `tag_with_ai`
- `deduplicate`
#### TimeTrackingTool
- `start_timer`
- `stop_timer`
- `pause_timer`
- `get_current_timer`
- `list_time_entries`
- `add_manual_entry`
- `delete_entry`
- `generate_timesheet`
- `get_project_summary`
- `calculate_billing`
- `export_to_invoice`
- `connect_toggl`
- `toggl_list_projects`
- `toggl_start_timer`
- `connect_clockify`
- `clockify_list_projects`
- `clockify_time_entry`
---
## Security & AI — 122
### CryptographyTool — 16
```python
from npmai_agents import CryptographyTool
```
| 方法 | 目的 | 关键参数 |
|---|---|---|
| `generate_rsa_keypair` | 生成RSA密钥 | `bits=4096, out_dir=""` |
| `encrypt_with_public_key` | RSA加密 | `data, public_key_path` |
| `decrypt_with_private_key` | RSA解密 | `encrypted_data, private_key_path` |
| `sign_data` | 私钥签名 | `data, private_key_path` |
| `verify_signature` | 验证签名 | `data, signature, public_key_path` |
| `aes_encrypt` | AES-256文件加密 | `file_path, key, output=""` |
| `aes_decrypt` | AES-256文件解密 | `file_path, key, output=""` |
| `generate_random_password` | 安全密码生成 | `length=32, special=True` |
| `hash_password` | bcrypt哈希 | `password` |
| `verify_password` | 验证bcrypt哈希 | `password, hash` |
| `generate_totp_secret` | TOTP 2FA设置 | `issuer, account` |
| `verify_totp` | 验证TOTP代码 | `secret, code` |
| `create_ssl_certificate` | 签发SSL证书 | `csr_path, ca_key, ca_cert, output=""` |
| `create_self_signed_cert` | 自签名证书 | `domain, days=365, output_dir=""` |
| `pgp_encrypt` | PGP加密 | `data, recipient_key` |
| `pgp_decrypt` | PGP解密 | `encrypted_data, private_key, passphrase` |
---
### KnowledgeBaseTool — 14
```python
from npmai_agents import KnowledgeBaseTool
```
| 方法 | 目的 | 关键参数 |
|---|---|---|
| `create_kb` | 创建知识库 | `name` |
| `add_documents` | 添加文档文件 | `kb_name, file_paths: list` |
| `add_url_to_kb` | 添加网页 | `kb_name, url` |
| `add_text` | 添加原始文本 | `kb_name, text, source=""` |
| `query_kb` | 使用RAG查询 | `kb_name, question` |
| `search_kb` | 关键词搜索 | `kb_name, query, top_k=5` |
| `update_document` | 更新文档 | `kb_name, doc_id, new_content` |
| `delete_document` | 删除文档 | `kb_name, doc_id` |
| `list_documents` | 列出知识库文档 | `kb_name` |
| `get_kb_stats` | 知识库统计 | `kb_name` |
| `export_kb` | 导出知识库 | `kb_name, output_path` |
| `import_kb` | 导入知识库 | `kb_path` |
| `create_qa_pairs` | 生成问答对 | `kb_name, source_doc` |
| `answer_with_sources` | 带引用的回答 | `kb_name, question` |
---
### SecurityScannerTool — 14
### PenetrationTestingTool — 11
### AIImageGenerationTool — 8
### AITextGenerationAdvancedTool — 12
### MLModelTool — 11
### SpeechAITool — 8
### ComputerVisionTool — 14
### AutomationWorkflowTool — 14
```python
from npmai_agents import SecurityScannerTool, PenetrationTestingTool
from npmai_agents import AIImageGenerationTool, AITextGenerationAdvancedTool
from npmai_agents import MLModelTool, SpeechAITool, ComputerVisionTool, AutomationWorkflowTool
```
#### SecurityScannerTool
- `check_virustotal`
- `scan_file_virustotal`
- `shodan_search`
- `shodan_host`
- `check_haveibeenpwned`
- `check_password_breach`
- `nmap_scan`
- `port_scan_common`
- `whois_lookup`
- `check_ssl_grade`
- `check_dns_leak`
- `scan_url_safe_browsing`
- `check_reputation`
- `get_threat_intel`
#### PenetrationTestingTool
- `subdomain_enumeration`
- `directory_bruteforce`
- `check_common_vulnerabilities`
- `check_http_headers`
- `check_cors`
- `sql_injection_test`
- `xss_test`
- `check_ssl_vulnerabilities`
- `check_outdated_software`
- `generate_security_report`
- `create_pentest_checklist`
#### AIImageGenerationTool
- `generate_image_stability`
- `generate_image_dalle`
- `generate_image_local_sd`
- `inpaint_image`
- `img_to_img`
- `upscale_image_ai`
- `remove_background_ai`
- `create_image_variations`
#### AITextGenerationAdvancedTool
- `chain_prompts`
- `few_shot_generate`
- `generate_structured_json`
- `debate_topic`
- `brainstorm`
- `critique_and_improve`
- `generate_code`
- `explain_code`
- `generate_test_cases`
- `refactor_code`
- `translate_text`
- `summarize_long_document`
#### MLModelTool
- `train_classifier`
- `train_regressor`
- `predict`
- `evaluate_model`
- `feature_importance`
- `cross_validate`
- `hyperparameter_tune`
- `save_model`
- `load_and_predict`
- `deploy_model_api`
- `explain_prediction`
#### SpeechAITool
- `transcribe_realtime`
- `transcribe_file`
- `speaker_diarization`
- `voice_activity_detection`
- `clone_and_speak`
- `real_time_translation`
- `command_recognition`
- `keyword_detection`
#### ComputerVisionTool
- `detect_objects`
- `track_objects`
- `recognize_faces`
- `detect_emotions`
- `read_text_ocr`
- `read_table_from_image`
- `scan_qr_barcode`
- `generate_qr_with_style`
- `classify_image`
- `compare_faces`
- `count_objects`
- `segment_image`
- `measure_object`
- `extract_text_from_pdf_image`
#### AutomationWorkflowTool
- `create_workflow`
- `run_workflow`
- `schedule_workflow`
- `list_scheduled_workflows`
- `cancel_scheduled_workflow`
- `get_workflow_history`
- `create_trigger_on_file_change`
- `create_trigger_on_email`
- `create_trigger_on_webhook`
- `chain_workflows`
- `create_conditional_branch`
- `retry_on_failure`
- `run_parallel`
- `create_loop_workflow`
---
## Verified Tool Count
| 类别 | 文件 | 类 | 工具 |
|---|---|---|---|
| Developer & CLI | `Tools_Developer_CLI.py` | 10 | 155 |
| Business & Payments | `Tools_business.py` | 10 | 152 |
| Cloud & DevOps | `Tools_cloud_devops.py` | 10 | 149 |
| Communication | `Tools_communication_extended.py` | 10 | 95 |
| Creative & Design | `Tools_creative.py` | 10 | 97 |
| Data & Research | `Tools_data_research.py` | 10 | 137 |
| Media & Audio/Video | `Tools_media.py` | 10 | 123 |
| Productivity & PM | `Tools_productivity.py` | 10 | 176 |
| Security & AI | `Tools_security_ai.py` | 10 | 122 |
| System & 10 | 122 |
| System & Hardware | `Tools_system_hardware.py` | 10 | 165 |
| **TOTAL** | **10 files** | **100** | **1,371** |
> Count verified programmatically from source code. Each public method = 1 tool. `__init__` excluded from count.
---
## 🚀 End-to-End Workflow
```bash
# 1. Install
pip install npmai_agents
# 2. Save your credentials (once)
npmai save-credentials openai '{"api_key":"sk-xxxx"}'
npmai save-credentials github '{"token":"ghp_xxxx"}'
npmai save-credentials stripe '{"secret_key":"sk_live_xxxx"}'
npmai save-credentials slack '{"bot_token":"xoxb-xxxx"}'
npmai save-credentials sendgrid '{"api_key":"SG.xxxx"}'
# 3. Optional — configure with better models
npmai config-agent \
--planner-provider groq --planner-model llama-3.3-70b-versatile \
--coder-provider openai --coder-model gpt-4o
# 4. Run any task in plain English
npmai run "Analyse the CSV files in my Downloads folder,
find the top 5 customers by revenue,
create an Excel report with charts,
and email it to sonu@npmai.ai with subject 'Weekly Revenue Report'"
```
```
▸ Starting task...
▸ Scanning workspace...
▸ Planning steps...
▸ Plan: 4 step(s)
1. Load and analyse CSV files from Downloads using DataAnalysisTool
2. Identify top 5 customers by revenue
3. Create Excel report with charts using ReportGeneratorTool
4. Send email with attachment using SendGridTool
▸ Tool Manager selecting tools...
✓ Selected: ['DataAnalysisTool', 'VisualizationTool', 'ReportGeneratorTool', 'SendGridTool']
▸ Step 1/4: Load and analyse CSV files
→ Generating code (attempt 1)...
→ Security audit...
✓ Audit passed
→ Executing...
✓ Step 1 complete
▸ Step 2/4: Identify top 5 customers
✓ Step 2 complete
▸ Step 3/4: Create Excel report with charts
✓ Step 3 complete
▸ Step 4/4: Send email with attachment
✓ Step 4 complete
✓ ─── All steps completed successfully ───
```
---
## 📋 Version History
| 版本 | 状态 | 备注 |
|---|---|---|
| `1.0.0` | ✅ 生产稳定 | 1,371 工具 · 100 类 · 5 角色管道 · 工具管理器 · 12 LLM 提供商 · CLI |
| `0.0.1` | 🗄️ 已归档 | 初始 alpha 版本 — 21 工具类 · 4 角色管道 |
---
## 📜 License
MIT — 免费使用、修改和分发。
---
<div align="center">
<img src="https://capsule-render.vercel.app/api?type=waving&color=0:0d1b4a,50:1a0a3a,100:0a0a1a&height=160§ion=footer&text=NPMAI+ECOSYSTEM&fontSize=32&fontColor=00f5ff&fontAlignY=55&desc=Open+Source+AI+Research+%26+Development+%C2%B7+Free+Forever&descColor=a78bfa&descSize=14&descAlignY=78" width="100%"/>
**由 [孙宇](https://github.com/sonuramashishnpm) 构建 💕 ** · [npmai.netlify.app](https://npmai.netlify.app)
*"推广 AI 工具到每个国家的村庄 — 免费且永远开放。"*
</div>
MCP 配置
以下是此 MCP Server 的配置信息,可直接复制到 Cursor 或其他 MCP 客户端中使用。
mcp.json
连接信息
猜你喜欢
暂无推荐服务器