mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
docs: make English the default docs language and fix link paths
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
---
|
||||
title: bash - 终端
|
||||
description: 执行系统命令
|
||||
title: bash - Terminal
|
||||
description: Execute system commands
|
||||
---
|
||||
|
||||
在当前工作目录执行 Bash 命令,返回 stdout 和 stderr。`env_config` 中配置的 API Key 会自动注入到环境变量中。
|
||||
Execute Bash commands in the current working directory, returns stdout and stderr. API keys configured via `env_config` are automatically injected into the environment.
|
||||
|
||||
## 依赖
|
||||
## Dependencies
|
||||
|
||||
无额外依赖,默认可用。
|
||||
No extra dependencies, available by default.
|
||||
|
||||
## 参数
|
||||
## Parameters
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `command` | string | 是 | 要执行的命令 |
|
||||
| `timeout` | integer | 否 | 超时时间(秒) |
|
||||
| `command` | string | Yes | Command to execute |
|
||||
| `timeout` | integer | No | Timeout in seconds |
|
||||
|
||||
## 使用场景
|
||||
## Use Cases
|
||||
|
||||
- 安装软件包和依赖
|
||||
- 运行代码和测试
|
||||
- 部署应用和服务(Nginx 配置、进程管理等)
|
||||
- 系统运维和排查
|
||||
- Install packages and dependencies
|
||||
- Run code and tests
|
||||
- Deploy applications and services (Nginx config, process management, etc.)
|
||||
- System administration and troubleshooting
|
||||
|
||||
<Frame>
|
||||
<img src="https://cdn.link-ai.tech/doc/20260203121008.png" width="800" />
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
---
|
||||
title: browser - 浏览器
|
||||
description: 控制浏览器访问和操作网页
|
||||
title: browser - Browser
|
||||
description: Control a browser to access and interact with web pages
|
||||
---
|
||||
|
||||
控制 Chromium 浏览器进行网页导航、元素交互和内容提取。支持 JavaScript 渲染的动态页面,使用精简 DOM 快照让 Agent 高效理解页面结构。
|
||||
Control a Chromium browser for web navigation, element interaction and content extraction. Supports JavaScript-rendered pages and uses a compact DOM snapshot so the Agent can efficiently understand page structure.
|
||||
|
||||
## 安装
|
||||
## Installation
|
||||
|
||||
<Tabs>
|
||||
<Tab title="CLI 安装(推荐)">
|
||||
<Tab title="CLI install (recommended)">
|
||||
```bash
|
||||
cow install-browser
|
||||
```
|
||||
|
||||
该命令会自动完成:
|
||||
- 安装 `playwright` Python 包(旧系统自动降级兼容版本)
|
||||
- 在 Linux 上安装系统依赖
|
||||
- 下载 Chromium 浏览器(Linux 服务器自动使用无头精简版)
|
||||
- 自动检测国内网络并使用镜像加速
|
||||
This command will:
|
||||
- Install the `playwright` Python package (with auto-fallback for older systems)
|
||||
- Install system dependencies on Linux
|
||||
- Download the Chromium browser (Linux servers automatically use the headless build)
|
||||
- Detect China-mainland networks and use mirror acceleration
|
||||
</Tab>
|
||||
<Tab title="手动安装">
|
||||
<Tab title="Manual install">
|
||||
```bash
|
||||
pip install playwright
|
||||
playwright install chromium
|
||||
```
|
||||
|
||||
Linux 服务器还需安装系统依赖:
|
||||
On Linux servers, install system dependencies as well:
|
||||
```bash
|
||||
sudo playwright install-deps chromium
|
||||
```
|
||||
|
||||
如果系统较旧(如 Ubuntu 18.04,glibc < 2.28),需安装兼容版本:
|
||||
On older systems (e.g. Ubuntu 18.04, glibc < 2.28), install a compatible version:
|
||||
```bash
|
||||
pip install playwright==1.28.0
|
||||
python -m playwright install chromium
|
||||
```
|
||||
|
||||
国内网络下载 Chromium 较慢,可设置镜像加速:
|
||||
To accelerate the Chromium download from China:
|
||||
```bash
|
||||
export PLAYWRIGHT_DOWNLOAD_HOST=https://registry.npmmirror.com/-/binary/playwright
|
||||
python -m playwright install chromium
|
||||
@@ -45,55 +45,55 @@ description: 控制浏览器访问和操作网页
|
||||
</Tabs>
|
||||
|
||||
<Note>
|
||||
1. 支持 Ubuntu 20.04+、Debian 10+、macOS、Windows。Ubuntu 18.04 等旧系统会自动降级安装兼容版本。
|
||||
2. 浏览器工具依赖较重(约300MB),为可选安装。轻量的网页内容获取可使用 `web_fetch` 工具。
|
||||
1. Supported on Ubuntu 20.04+, Debian 10+, macOS and Windows. Older systems such as Ubuntu 18.04 will fall back to a compatible version automatically.
|
||||
2. The browser tool has heavy dependencies (~300MB) and is optional. For lightweight web content retrieval, use the `web_fetch` tool.
|
||||
</Note>
|
||||
|
||||
## 工作流程
|
||||
## Workflow
|
||||
|
||||
Agent 使用浏览器的典型流程:
|
||||
A typical browser workflow for the Agent:
|
||||
|
||||
1. **`navigate`** — 打开目标 URL
|
||||
2. **`snapshot`** — 获取页面精简 DOM,交互元素自动编号(ref)
|
||||
3. **`click` / `fill` / `select`** — 通过 ref 编号操作元素
|
||||
4. **`snapshot`** — 再次快照验证操作结果
|
||||
1. **`navigate`** — Open the target URL
|
||||
2. **`snapshot`** — Get a compact DOM with auto-numbered interactive elements (`ref`)
|
||||
3. **`click` / `fill` / `select`** — Operate elements by `ref`
|
||||
4. **`snapshot`** — Snapshot again to verify the result
|
||||
|
||||
## 支持的操作
|
||||
## Supported Actions
|
||||
|
||||
| 操作 | 说明 | 关键参数 |
|
||||
| Action | Description | Key parameters |
|
||||
| --- | --- | --- |
|
||||
| `navigate` | 打开 URL | `url` |
|
||||
| `snapshot` | 获取页面结构化文本(主要方式) | `selector`(可选) |
|
||||
| `click` | 点击元素 | `ref` 或 `selector` |
|
||||
| `fill` | 填入文本 | `ref` 或 `selector`,`text` |
|
||||
| `select` | 下拉选择 | `ref` 或 `selector`,`value` |
|
||||
| `scroll` | 滚动页面 | `direction`(up/down/left/right) |
|
||||
| `screenshot` | 截图保存到工作区 | `full_page` |
|
||||
| `wait` | 等待元素或超时 | `selector`,`timeout` |
|
||||
| `press` | 按键(Enter、Tab 等) | `key` |
|
||||
| `back` / `forward` | 浏览器前进/后退 | - |
|
||||
| `get_text` | 获取元素文本内容 | `selector` |
|
||||
| `evaluate` | 执行 JavaScript | `script` |
|
||||
| `navigate` | Open URL | `url` |
|
||||
| `snapshot` | Get structured page text (primary way) | `selector` (optional) |
|
||||
| `click` | Click an element | `ref` or `selector` |
|
||||
| `fill` | Fill text into an input | `ref` or `selector`, `text` |
|
||||
| `select` | Select a dropdown option | `ref` or `selector`, `value` |
|
||||
| `scroll` | Scroll the page | `direction` (up/down/left/right) |
|
||||
| `screenshot` | Save a screenshot to the workspace | `full_page` |
|
||||
| `wait` | Wait for an element or timeout | `selector`, `timeout` |
|
||||
| `press` | Press a key (Enter, Tab, etc.) | `key` |
|
||||
| `back` / `forward` | Browser back / forward | - |
|
||||
| `get_text` | Get an element's text content | `selector` |
|
||||
| `evaluate` | Run JavaScript | `script` |
|
||||
|
||||
## 使用场景
|
||||
## Use Cases
|
||||
|
||||
- 访问指定 URL 获取动态页面内容
|
||||
- 填写表单、登录操作
|
||||
- 操作网页元素(点击按钮、选择选项等)
|
||||
- 验证部署后的网页效果
|
||||
- 抓取需要 JS 渲染的动态内容
|
||||
- Access a URL to retrieve dynamic page content
|
||||
- Fill in forms and log in
|
||||
- Operate web elements (click buttons, select options, etc.)
|
||||
- Verify the result of a deployed web page
|
||||
- Scrape content that requires JS rendering
|
||||
|
||||
## 运行模式
|
||||
## Run Mode
|
||||
|
||||
浏览器会根据运行环境自动选择模式:
|
||||
The browser picks a mode based on the runtime environment:
|
||||
|
||||
| 环境 | 模式 |
|
||||
| Environment | Mode |
|
||||
| --- | --- |
|
||||
| macOS / Windows | 有头模式(显示浏览器窗口) |
|
||||
| Linux 桌面(有 DISPLAY) | 有头模式 |
|
||||
| Linux 服务器(无 DISPLAY) | 无头模式(headless) |
|
||||
| macOS / Windows | Headed (browser window visible) |
|
||||
| Linux desktop (with DISPLAY) | Headed |
|
||||
| Linux server (no DISPLAY) | Headless |
|
||||
|
||||
可在 `config.json` 中手动覆盖:
|
||||
You can override it in `config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -105,15 +105,15 @@ Agent 使用浏览器的典型流程:
|
||||
}
|
||||
```
|
||||
|
||||
## 登录态持久化
|
||||
## Persistent Login
|
||||
|
||||
**只需登录一次目标网站,Agent 后续可直接使用**。提供两种方式:
|
||||
**Log in to a target site once and the Agent can keep using it.** Two ways are supported:
|
||||
|
||||
### 方式一:Persistent 模式(默认)
|
||||
### Option 1: Persistent mode (default)
|
||||
|
||||
开箱即用,登录信息保存在 `~/.cow/browser_profile`。无需任何配置。
|
||||
Works out of the box. Login state is saved under `~/.cow/browser_profile`. No configuration needed.
|
||||
|
||||
如需关闭持久化模式,每次都用纯净环境:
|
||||
To disable persistence and start with a clean environment every time:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -125,11 +125,11 @@ Agent 使用浏览器的典型流程:
|
||||
}
|
||||
```
|
||||
|
||||
### 方式二:CDP 模式(接管真实 Chrome)
|
||||
### Option 2: CDP mode (attach to real Chrome)
|
||||
|
||||
让 Agent 连接独立启动的真实 Chrome(而非 Playwright 自带的 Chromium),获得完整浏览器指纹,适合反爬严格的网站。
|
||||
Have the Agent connect to a separately launched real Chrome (instead of the Chromium bundled with Playwright) for full browser fingerprints. Useful for sites with strict bot detection.
|
||||
|
||||
启动 Chrome 时加上调试端口和独立用户目录:
|
||||
Launch Chrome with a debugging port and a dedicated user data directory:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="macOS">
|
||||
@@ -155,7 +155,7 @@ Agent 使用浏览器的典型流程:
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
在 `config.json` 中配置端点:
|
||||
Then point the Agent at the endpoint in `config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -168,5 +168,5 @@ Agent 使用浏览器的典型流程:
|
||||
```
|
||||
|
||||
<Note>
|
||||
Chrome 137+ 限制 `--remote-debugging-port` 必须搭配独立 `--user-data-dir`,因此 CDP 启动的 Chrome **无法直接复用你日常 Chrome 的登录态**,需要在独立目录中重新登录一次。
|
||||
Chrome 137+ requires `--remote-debugging-port` to be paired with a dedicated `--user-data-dir`. As a result, the CDP-launched Chrome **cannot directly reuse the login state of your daily Chrome**; you'll need to log in once inside this dedicated profile.
|
||||
</Note>
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
---
|
||||
title: edit - 文件编辑
|
||||
description: 通过精确文本替换编辑文件
|
||||
title: edit - File Edit
|
||||
description: Edit files via precise text replacement
|
||||
---
|
||||
|
||||
通过精确文本替换编辑文件。如果 `oldText` 为空则追加到文件末尾。
|
||||
Edit files via precise text replacement. If `oldText` is empty, appends to the end of the file.
|
||||
|
||||
## 依赖
|
||||
## Dependencies
|
||||
|
||||
无额外依赖,默认可用。
|
||||
No extra dependencies, available by default.
|
||||
|
||||
## 参数
|
||||
## Parameters
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `path` | string | 是 | 文件路径 |
|
||||
| `oldText` | string | 是 | 要替换的原始文本(为空时追加到末尾) |
|
||||
| `newText` | string | 是 | 替换后的文本 |
|
||||
| `path` | string | Yes | File path |
|
||||
| `oldText` | string | Yes | Original text to replace (empty to append) |
|
||||
| `newText` | string | Yes | Replacement text |
|
||||
|
||||
## 使用场景
|
||||
## Use Cases
|
||||
|
||||
- 修改配置文件中的特定参数
|
||||
- 修复代码中的 bug
|
||||
- 在文件指定位置插入内容
|
||||
- Modify specific parameters in configuration files
|
||||
- Fix bugs in code
|
||||
- Insert content at specific positions in files
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
---
|
||||
title: env_config - 环境变量
|
||||
description: 管理 API Key 等秘钥配置
|
||||
title: env_config - Environment
|
||||
description: Manage API keys and secrets
|
||||
---
|
||||
|
||||
管理工作空间 `.env` 文件中的环境变量(API Key 等秘钥),支持通过对话安全地添加和更新。内置安全保护和脱敏策略。
|
||||
Manage environment variables (API keys and secrets) in the workspace `.env` file, with secure conversational updates. Built-in security protection and desensitization.
|
||||
|
||||
## 依赖
|
||||
## Dependencies
|
||||
|
||||
| 依赖 | 安装命令 |
|
||||
| Dependency | Install Command |
|
||||
| --- | --- |
|
||||
| `python-dotenv` ≥ 1.0.0 | `pip install python-dotenv>=1.0.0` |
|
||||
|
||||
安装扩展依赖时已包含:`pip3 install -r requirements-optional.txt`
|
||||
Included when installing optional dependencies: `pip3 install -r requirements-optional.txt`
|
||||
|
||||
## 参数
|
||||
## Parameters
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `action` | string | 是 | 操作类型:`get`、`set`、`list`、`delete` |
|
||||
| `key` | string | 否 | 环境变量名称 |
|
||||
| `value` | string | 否 | 环境变量值(仅 `set` 时需要) |
|
||||
| `action` | string | Yes | Operation type: `get`, `set`, `list`, `delete` |
|
||||
| `key` | string | No | Environment variable name |
|
||||
| `value` | string | No | Environment variable value (only for `set`) |
|
||||
|
||||
## 使用方式
|
||||
## Usage
|
||||
|
||||
直接告诉 Agent 需要配置的秘钥,Agent 会自动调用该工具:
|
||||
Tell the Agent what key you need to configure, and it will automatically invoke this tool:
|
||||
|
||||
- "帮我配置 BOCHA_API_KEY"
|
||||
- "设置 OPENAI_API_KEY 为 sk-xxx"
|
||||
- "查看已配置的环境变量"
|
||||
- "Configure my BOCHA_API_KEY"
|
||||
- "Set OPENAI_API_KEY to sk-xxx"
|
||||
- "Show configured environment variables"
|
||||
|
||||
配置的秘钥会自动注入到 `bash` 工具的执行环境中。
|
||||
Configured keys are automatically injected into the `bash` tool's execution environment.
|
||||
|
||||
<Frame>
|
||||
<img src="https://cdn.link-ai.tech/doc/20260202234939.png" width="800" />
|
||||
|
||||
@@ -1,69 +1,60 @@
|
||||
---
|
||||
title: 工具概览
|
||||
description: CowAgent 内置工具系统
|
||||
title: Tools Overview
|
||||
description: CowAgent built-in tools system
|
||||
---
|
||||
|
||||
工具是 Agent 访问操作系统资源的核心能力。Agent 会根据任务需求智能选择和调用工具,完成文件操作、命令执行、联网搜索、定时任务等各类操作。工具实现在项目的 `agent/tools/` 目录下。
|
||||
Tools are the core capability for Agent to access operating system resources. The Agent intelligently selects and invokes tools based on task requirements, performing file operations, command execution, web search, scheduled tasks, and more. Tools are implemented in the `agent/tools/` directory.
|
||||
|
||||
## 内置工具
|
||||
## Built-in Tools
|
||||
|
||||
以下工具默认可用,无需额外配置:
|
||||
The following tools are available by default with no extra configuration:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="read - 文件读取" icon="file" href="/tools/read">
|
||||
读取文件内容,支持文本、图片、PDF
|
||||
<Card title="read - File Read" icon="file" href="/tools/read">
|
||||
Read file content, supports text, images, PDF
|
||||
</Card>
|
||||
<Card title="write - 文件写入" icon="pen" href="/tools/write">
|
||||
创建或覆盖写入文件
|
||||
<Card title="write - File Write" icon="pen" href="/tools/write">
|
||||
Create or overwrite files
|
||||
</Card>
|
||||
<Card title="edit - 文件编辑" icon="pen-to-square" href="/tools/edit">
|
||||
通过精确文本替换编辑文件
|
||||
<Card title="edit - File Edit" icon="pen-to-square" href="/tools/edit">
|
||||
Edit files via precise text replacement
|
||||
</Card>
|
||||
<Card title="ls - 目录列表" icon="folder-open" href="/tools/ls">
|
||||
列出目录内容
|
||||
<Card title="ls - Directory List" icon="folder-open" href="/tools/ls">
|
||||
List directory contents
|
||||
</Card>
|
||||
<Card title="bash - 终端" icon="terminal" href="/tools/bash">
|
||||
执行系统命令
|
||||
<Card title="bash - Terminal" icon="terminal" href="/tools/bash">
|
||||
Execute system commands
|
||||
</Card>
|
||||
<Card title="send - 文件发送" icon="paper-plane" href="/tools/send">
|
||||
向用户发送文件或图片
|
||||
<Card title="send - File Send" icon="paper-plane" href="/tools/send">
|
||||
Send files or images to user
|
||||
</Card>
|
||||
<Card title="memory - 记忆" icon="brain" href="/tools/memory">
|
||||
搜索和读取长期记忆
|
||||
</Card>
|
||||
<Card title="env_config - 环境变量" icon="key" href="/tools/env-config">
|
||||
管理 API Key 等秘钥配置
|
||||
</Card>
|
||||
<Card title="web_fetch - 网页获取" icon="globe" href="/tools/web-fetch">
|
||||
获取网页或文档内容
|
||||
</Card>
|
||||
<Card title="scheduler - 定时任务" icon="clock" href="/tools/scheduler">
|
||||
创建和管理定时任务
|
||||
<Card title="memory - Memory" icon="brain" href="/tools/memory">
|
||||
Search and read long-term memory
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## 可选工具
|
||||
## Optional Tools
|
||||
|
||||
以下工具需要安装额外依赖或配置 API Key 后启用:
|
||||
The following tools require additional dependencies or API key configuration:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="web_search - 联网搜索" icon="magnifying-glass" href="/tools/web-search">
|
||||
搜索互联网获取实时信息
|
||||
<Card title="env_config - Environment" icon="key" href="/tools/env-config">
|
||||
Manage API keys and secrets
|
||||
</Card>
|
||||
<Card title="vision - 图片理解" icon="eye" href="/tools/vision">
|
||||
分析图片内容(识别、描述、OCR 文字提取等)
|
||||
<Card title="scheduler - Scheduler" icon="clock" href="/tools/scheduler">
|
||||
Create and manage scheduled tasks
|
||||
</Card>
|
||||
<Card title="browser - 浏览器" icon="window" href="/tools/browser">
|
||||
控制浏览器访问和操作网页
|
||||
<Card title="web_search - Web Search" icon="magnifying-glass" href="/tools/web-search">
|
||||
Search the internet for real-time information
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## MCP 工具
|
||||
## MCP Tools
|
||||
|
||||
通过 [Model Context Protocol](https://modelcontextprotocol.io) 接入社区生态中的各种MCP工具,配置一次 `mcp.json` 即用即得:
|
||||
Integrate thousands of community tools (maps, GitHub, Notion, etc.) via the [Model Context Protocol](https://modelcontextprotocol.io). Configure `mcp.json` once, ready to use:
|
||||
|
||||
<CardGroup cols={1}>
|
||||
<Card title="MCP - 外部工具生态" icon="plug" href="/tools/mcp">
|
||||
支持 stdio / SSE 标准协议,热更新,零代码接入
|
||||
<Card title="MCP - External Tool Ecosystem" icon="plug" href="/tools/mcp">
|
||||
Supports standard stdio / SSE transports. Hot-reload, zero code changes.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
---
|
||||
title: ls - 目录列表
|
||||
description: 列出目录内容
|
||||
title: ls - Directory List
|
||||
description: List directory contents
|
||||
---
|
||||
|
||||
列出目录内容,按字母排序,目录名带 `/` 后缀,包含隐藏文件。
|
||||
List directory contents, sorted alphabetically, directories suffixed with `/`, includes hidden files.
|
||||
|
||||
## 依赖
|
||||
## Dependencies
|
||||
|
||||
无额外依赖,默认可用。
|
||||
No extra dependencies, available by default.
|
||||
|
||||
## 参数
|
||||
## Parameters
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `path` | string | 是 | 目录路径,相对路径基于工作空间目录 |
|
||||
| `limit` | integer | 否 | 最大返回条目数,默认 500 |
|
||||
| `path` | string | Yes | Directory path, relative paths are based on workspace directory |
|
||||
| `limit` | integer | No | Maximum entries to return, default 500 |
|
||||
|
||||
## 使用场景
|
||||
## Use Cases
|
||||
|
||||
- 浏览项目结构
|
||||
- 查找特定文件
|
||||
- 检查目录是否存在
|
||||
- Browse project structure
|
||||
- Find specific files
|
||||
- Check if a directory exists
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
---
|
||||
title: MCP 工具
|
||||
description: 通过 Model Context Protocol 接入外部工具生态
|
||||
title: MCP Tools
|
||||
description: Integrate external tool ecosystems via the Model Context Protocol
|
||||
---
|
||||
|
||||
CowAgent 支持 [Model Context Protocol (MCP)](https://modelcontextprotocol.io),让 Agent 能够直接调用社区中数以万计的 MCP 工具。配置一次 `mcp.json`,工具就会以与内置工具完全相同的方式呈现给 LLM,可被自动选择和调用。
|
||||
CowAgent supports the [Model Context Protocol (MCP)](https://modelcontextprotocol.io), allowing the Agent to directly invoke tens of thousands of community MCP tools. Configure `mcp.json` once and the tools are exposed to the LLM in exactly the same way as built-in tools — automatically selected and invoked.
|
||||
|
||||
## 配置文件
|
||||
## Configuration File
|
||||
|
||||
CowAgent 读取 `~/cow/mcp.json`。文件不存在时不会启用任何 MCP 工具,也不会报错。
|
||||
CowAgent reads `~/cow/mcp.json`. If the file does not exist, no MCP tools are loaded — and no error is raised.
|
||||
|
||||
Docker 部署时,官方 `docker-compose.yml` 已经把宿主机 `./cow` 挂载到容器内 `/home/agent/cow`(即容器用户的 `~/cow`),把 `mcp.json` 放进宿主机 `./cow/` 目录即可生效。
|
||||
For Docker deployments, the official `docker-compose.yml` already mounts the host's `./cow` directory to `/home/agent/cow` inside the container (i.e. the container user's `~/cow`). Just drop `mcp.json` into the host's `./cow/` directory and it will take effect.
|
||||
|
||||
### 标准格式
|
||||
### Standard Format
|
||||
|
||||
完全兼容 MCP 社区标准,同 Claude Desktop / Cursor 一致:
|
||||
Fully compatible with the MCP community standard, identical to Claude Desktop / Cursor:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -29,17 +29,17 @@ Docker 部署时,官方 `docker-compose.yml` 已经把宿主机 `./cow` 挂载
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 必填 | 说明 |
|
||||
| Field | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `command` | stdio | 启动 server 的可执行命令(如 `npx`、`python`、`uvx`) |
|
||||
| `args` | 否 | 传给 command 的参数列表 |
|
||||
| `env` | 否 | 子进程的环境变量,常用于 API Key |
|
||||
| `url` | SSE / Streamable HTTP | 远程端点 URL(与 `command` 二选一) |
|
||||
| `type` | 远程 | 远程传输类型,可选 `sse` 或 `streamable-http`,默认 `sse` |
|
||||
| `headers` | 否 | 远程请求附加 HTTP 头(如 `Authorization`),仅 Streamable HTTP 使用 |
|
||||
| `disabled` | 否 | `true` 时跳过该 server,便于临时关闭 |
|
||||
| `command` | stdio | Executable to launch the server (e.g. `npx`, `python`, `uvx`) |
|
||||
| `args` | No | Arguments passed to `command` |
|
||||
| `env` | No | Environment variables for the subprocess, commonly used for API keys |
|
||||
| `url` | SSE / Streamable HTTP | Remote endpoint URL (alternative to `command`) |
|
||||
| `type` | Remote | Remote transport type: `sse` or `streamable-http` (defaults to `sse`) |
|
||||
| `headers` | No | Extra HTTP headers for remote requests (e.g. `Authorization`); Streamable HTTP only |
|
||||
| `disabled` | No | When `true`, this server is skipped — handy for temporary disabling |
|
||||
|
||||
### 完整示例
|
||||
### Full Example
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -59,54 +59,54 @@ Docker 部署时,官方 `docker-compose.yml` 已经把宿主机 `./cow` 挂载
|
||||
}
|
||||
```
|
||||
|
||||
- **fetch**:通用网页抓取,返回页面文本内容,无需 API Key
|
||||
- **github**:访问 GitHub 仓库、Issue、PR 等,需要 Personal Access Token
|
||||
- **fetch**: Generic web page fetcher that returns page text content. No API key required.
|
||||
- **github**: Access GitHub repos, issues, PRs, etc. Requires a Personal Access Token.
|
||||
|
||||
## 让 Agent 帮你配置
|
||||
## Let the Agent Configure It for You
|
||||
|
||||
CowAgent 自带 `read` / `write` / `edit` 工具,**直接把要装的 MCP 配置发给 Agent,让它写到配置文件中:
|
||||
CowAgent ships with `read` / `write` / `edit` tools, so **you can simply send the MCP config to the Agent and ask it to write the file**:
|
||||
|
||||
例如:
|
||||
For example:
|
||||
|
||||
```markdown
|
||||
帮我把这个 MCP 加到 ~/cow/mcp.json 里:
|
||||
Add this MCP to ~/cow/mcp.json:
|
||||
|
||||
{"mcpServers":{"fetch":{"command":"uvx","args":["mcp-server-fetch"]}}}
|
||||
```
|
||||
|
||||
Agent 会:
|
||||
The Agent will:
|
||||
|
||||
1. 访问 MCP 配置文件,合并新 server 配置,保留已有项
|
||||
2. 自动重载增量的 MCP Server,下一次对话即可使用相应 Tools
|
||||
1. Read the existing MCP config and merge the new server entry, preserving existing ones
|
||||
2. Hot-reload the new MCP server, so the corresponding tools become available on the next message
|
||||
|
||||
## 工作方式
|
||||
## How It Works
|
||||
|
||||
- 启动时**异步加载**:`mcp.json` 中配置的所有 server 会在后台异步加载,不阻塞主流程,对话可以立刻使用
|
||||
- **热更新**:用户或 Agent 修改 `mcp.json` 后,消息处理完成时会自动重载变更的 server,无需重启 cow
|
||||
- **平铺呈现**:每个 MCP server 暴露的多个方法会平铺为独立的工具,LLM 直接选择调用,不需要二次决策
|
||||
- **Async loading at startup**: All servers configured in `mcp.json` are loaded asynchronously in the background, never blocking the main loop — chat is usable immediately.
|
||||
- **Hot reload**: When you or the Agent modifies `mcp.json`, changed servers are automatically reloaded after the current message — no need to restart cow.
|
||||
- **Flat exposure**: Each method exposed by an MCP server appears as an individual tool. The LLM picks one directly without a second-stage decision.
|
||||
|
||||
## 支持的传输协议
|
||||
## Supported Transports
|
||||
|
||||
| 协议 | 说明 | 配置字段 |
|
||||
| Transport | Description | Config Field |
|
||||
| --- | --- | --- |
|
||||
| **stdio** | 子进程通信,最常见,社区生态最丰富 | `command` + `args` |
|
||||
| **SSE** | HTTP Server-Sent Events,旧版远程协议 | `url`(默认) |
|
||||
| **Streamable HTTP** | 新版远程协议,单端点收发,逐步取代 SSE | `type: "streamable-http"` + `url` |
|
||||
| **stdio** | Subprocess communication. The most common option, with the richest community ecosystem. | `command` + `args` |
|
||||
| **SSE** | HTTP Server-Sent Events. Legacy remote transport. | `url` (default) |
|
||||
| **Streamable HTTP** | New unified remote transport, gradually replacing SSE. | `type: "streamable-http"` + `url` |
|
||||
|
||||
## 排错
|
||||
## Troubleshooting
|
||||
|
||||
| 现象 | 排查方向 |
|
||||
| Symptom | What to Check |
|
||||
| --- | --- |
|
||||
| 启动后 Agent 没有 MCP 工具 | 检查 `~/cow/mcp.json` 是否存在、JSON 格式是否合法 |
|
||||
| 某个 server 加载失败 | 查看启动日志中的 `[MCP] Server 'xxx' load failed`,常见为依赖未装、API Key 缺失 |
|
||||
| 修改 `mcp.json` 没有生效 | 改动会在**下一条消息**生效;若 server 配置不变(如只改注释),不会触发重启 |
|
||||
| Docker 部署 | 确认宿主机 `./cow` 已挂载到容器内 `/home/agent/cow`,`mcp.json` 直接放进宿主机 `./cow/` 目录即可,或者直接对话 Agent 安装 |
|
||||
| Agent has no MCP tools after startup | Verify that `~/cow/mcp.json` exists and contains valid JSON |
|
||||
| A specific server fails to load | Look for `[MCP] Server 'xxx' load failed` in startup logs — usually missing dependencies or API keys |
|
||||
| Changes to `mcp.json` aren't applied | Changes take effect on **the next message**. If the server config didn't actually change (e.g. only comments edited), no restart is triggered |
|
||||
| Docker deployment | Make sure host's `./cow` is mounted to `/home/agent/cow` in the container, then just drop `mcp.json` into host's `./cow/`. Or just ask the Agent to do it |
|
||||
|
||||
## MCP 市场推荐
|
||||
## Recommended MCP Marketplaces
|
||||
|
||||
可以从各个第三方广场寻找现成的 MCP server,复制 JSON 配置即可使用,例如:
|
||||
You can browse third-party MCP marketplaces and copy a JSON config to use directly, for example:
|
||||
|
||||
- [mcp.so](https://mcp.so) — 全球 MCP 服务索引
|
||||
- [ModelScope MCP 广场](https://modelscope.cn/mcp) — 魔搭社区 MCP 广场,国内访问更稳定
|
||||
- [mcp.so](https://mcp.so) — Global MCP service index
|
||||
- [ModelScope MCP Hub](https://modelscope.cn/mcp) — ModelScope's MCP hub, more reliable from mainland China
|
||||
|
||||
只要遵循 MCP 标准协议(stdio / SSE / Streamable HTTP),都可以直接接入 CowAgent。
|
||||
Any MCP server that follows the standard protocol (stdio / SSE / Streamable HTTP) integrates with CowAgent out of the box.
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
---
|
||||
title: memory - 记忆与知识
|
||||
description: 搜索和读取长期记忆及知识库文件
|
||||
title: memory - Memory & Knowledge
|
||||
description: Search and read long-term memory and knowledge base files
|
||||
---
|
||||
|
||||
记忆工具包含两个子工具:`memory_search`(搜索记忆)和 `memory_get`(读取记忆或知识文件)。
|
||||
The memory tool contains two sub-tools: `memory_search` (search memory) and `memory_get` (read memory or knowledge files).
|
||||
|
||||
当 [知识库](/knowledge) 功能开启时,这两个工具同时支持访问 `memory/` 和 `knowledge/` 目录下的文件。
|
||||
When the [knowledge base](/knowledge) feature is enabled, both tools also support accessing files under the `knowledge/` directory.
|
||||
|
||||
## 依赖
|
||||
## Dependencies
|
||||
|
||||
无额外依赖,默认可用。由 Agent Core 的记忆系统管理。
|
||||
No extra dependencies, available by default. Managed by the Agent Core memory system.
|
||||
|
||||
## memory_search
|
||||
|
||||
搜索历史记忆和知识库内容,支持关键词和向量混合检索。
|
||||
Search historical memory and knowledge base content with hybrid keyword and vector retrieval.
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `query` | string | 是 | 搜索查询 |
|
||||
| `query` | string | Yes | Search query |
|
||||
|
||||
## memory_get
|
||||
|
||||
读取特定记忆文件或知识库文件的内容。
|
||||
Read the content of a specific memory or knowledge file.
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `path` | string | 是 | 文件的相对路径(如 `MEMORY.md`、`memory/2026-01-01.md`、`knowledge/concepts/rag.md`) |
|
||||
| `start_line` | integer | 否 | 起始行号 |
|
||||
| `end_line` | integer | 否 | 结束行号 |
|
||||
| `path` | string | Yes | Relative path to the file (e.g. `MEMORY.md`, `memory/2026-01-01.md`, `knowledge/concepts/rag.md`) |
|
||||
| `start_line` | integer | No | Start line number |
|
||||
| `end_line` | integer | No | End line number |
|
||||
|
||||
## 工作方式
|
||||
## How It Works
|
||||
|
||||
Agent 会在以下场景自动调用记忆工具:
|
||||
The Agent automatically invokes memory tools in these scenarios:
|
||||
|
||||
- 用户分享重要信息时 → 存储到记忆
|
||||
- 需要参考历史信息时 → 搜索相关记忆
|
||||
- 对话达到一定长度时 → 提取摘要存储
|
||||
- 讨论到专业知识时 → 检索知识库中的相关页面
|
||||
- When the user shares important information → stores to memory
|
||||
- When historical context is needed → searches relevant memory
|
||||
- When conversation reaches a certain length → extracts summary for storage
|
||||
- When discussing domain knowledge → retrieves relevant pages from the knowledge base
|
||||
|
||||
<Note>
|
||||
当 `knowledge` 配置为 `false` 时,工具的描述和搜索范围会自动调整为仅包含记忆文件。
|
||||
When `knowledge` is set to `false` in config, the tool descriptions and search scope automatically adjust to include only memory files.
|
||||
</Note>
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
---
|
||||
title: read - 文件读取
|
||||
description: 读取文件内容
|
||||
title: read - File Read
|
||||
description: Read file content
|
||||
---
|
||||
|
||||
读取文件内容。支持文本文件、PDF 文件、图片(返回元数据)等格式。
|
||||
Read file content. Supports text files, PDF files, images (returns metadata), and more.
|
||||
|
||||
## 依赖
|
||||
## Dependencies
|
||||
|
||||
无额外依赖,默认可用。
|
||||
No extra dependencies, available by default.
|
||||
|
||||
## 参数
|
||||
## Parameters
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `path` | string | 是 | 文件路径,相对路径基于工作空间目录 |
|
||||
| `offset` | integer | 否 | 起始行号(1-indexed),负值表示从末尾读取 |
|
||||
| `limit` | integer | 否 | 读取行数 |
|
||||
| `path` | string | Yes | File path, relative paths are based on workspace directory |
|
||||
| `offset` | integer | No | Start line number (1-indexed), negative values read from the end |
|
||||
| `limit` | integer | No | Number of lines to read |
|
||||
|
||||
## 使用场景
|
||||
## Use Cases
|
||||
|
||||
- 查看配置文件、日志文件
|
||||
- 读取代码文件进行分析
|
||||
- 检查图片/视频的文件信息
|
||||
- View configuration files, log files
|
||||
- Read code files for analysis
|
||||
- Check image/video file info
|
||||
|
||||
@@ -1,61 +1,61 @@
|
||||
---
|
||||
title: scheduler - 定时任务
|
||||
description: 创建和管理定时任务
|
||||
title: scheduler - Scheduler
|
||||
description: Create and manage scheduled tasks
|
||||
---
|
||||
|
||||
创建和管理动态定时任务,支持灵活的调度方式和执行模式。
|
||||
Create and manage dynamic scheduled tasks with flexible scheduling and execution modes.
|
||||
|
||||
## 依赖
|
||||
## Dependencies
|
||||
|
||||
| 依赖 | 安装命令 |
|
||||
| Dependency | Install Command |
|
||||
| --- | --- |
|
||||
| `croniter` ≥ 2.0.0 | `pip install croniter>=2.0.0` |
|
||||
|
||||
安装核心依赖时已包含:`pip3 install -r requirements.txt`
|
||||
Included in core dependencies: `pip3 install -r requirements.txt`
|
||||
|
||||
## 调度方式
|
||||
## Scheduling Modes
|
||||
|
||||
| 方式 | 说明 |
|
||||
| Mode | Description |
|
||||
| --- | --- |
|
||||
| 一次性任务 | 在指定时间执行一次 |
|
||||
| 固定间隔 | 按固定时间间隔重复执行 |
|
||||
| Cron 表达式 | 使用 Cron 语法定义复杂调度规则 |
|
||||
| One-time | Execute once at a specified time |
|
||||
| Fixed interval | Repeat at fixed time intervals |
|
||||
| Cron expression | Define complex schedules using Cron syntax |
|
||||
|
||||
## 执行模式
|
||||
## Execution Modes
|
||||
|
||||
- **固定消息发送**:到达触发时间时发送预设消息
|
||||
- **Agent 动态任务**:到达触发时间时由 Agent 智能执行任务
|
||||
- **Fixed message**: Send a preset message when triggered
|
||||
- **Agent dynamic task**: Agent intelligently executes the task when triggered
|
||||
|
||||
## 使用方式
|
||||
## Usage
|
||||
|
||||
通过自然语言即可创建和管理定时任务:
|
||||
Create and manage scheduled tasks with natural language:
|
||||
|
||||
- "每天早上 9 点给我发天气预报"
|
||||
- "每隔 2 小时检查一下服务器状态"
|
||||
- "明天下午 3 点提醒我开会"
|
||||
- "查看所有定时任务"
|
||||
- "Send me a weather report every morning at 9 AM"
|
||||
- "Check server status every 2 hours"
|
||||
- "Remind me about the meeting tomorrow at 3 PM"
|
||||
- "Show all scheduled tasks"
|
||||
|
||||
<Frame>
|
||||
<img src="https://cdn.link-ai.tech/doc/20260202195402.png" width="800" />
|
||||
</Frame>
|
||||
|
||||
## 结果进入会话上下文
|
||||
## Results injected into the conversation
|
||||
|
||||
定时任务在隔离 session 中执行(内部规划与 tool 调用不污染用户会话),但**最终输出**会作为一对消息回写到接收者的真实会话,用户可以直接追问"刚才那条第二点展开说说"。
|
||||
Scheduled tasks run inside an isolated session (so internal planning and tool calls do not pollute the user's chat), but the **final output** is written back to the user's real session as a message pair. You can directly follow up — e.g. "expand on point 2 from earlier".
|
||||
|
||||
**默认策略**
|
||||
**Default policy**
|
||||
|
||||
- Agent 动态任务的输出进入上下文
|
||||
- 固定消息类任务默认不进入上下文(可通过配置打开)
|
||||
- 每个会话最多保留最近 **3 对** scheduler 消息,更早的自动清理;普通用户消息不受影响
|
||||
- Output of Agent dynamic tasks is injected into the conversation
|
||||
- Fixed-message tasks are not injected by default (configurable)
|
||||
- Each session keeps the most recent **3 pairs** of scheduler messages; older pairs are pruned automatically. Regular user messages are unaffected
|
||||
|
||||
**配置项**
|
||||
**Configuration**
|
||||
|
||||
| 配置项 | 默认值 | 说明 |
|
||||
| Key | Default | Description |
|
||||
| --- | --- | --- |
|
||||
| `scheduler_inject_to_session` | `true` | 总开关 |
|
||||
| `scheduler_inject_max_per_session` | `3` | 每会话保留 scheduler 消息对数上限 |
|
||||
| `scheduler_inject_send_message` | `false` | 是否同时注入固定消息类任务 |
|
||||
| `scheduler_inject_to_session` | `true` | Master switch |
|
||||
| `scheduler_inject_max_per_session` | `3` | Max scheduler message pairs kept per session |
|
||||
| `scheduler_inject_send_message` | `false` | Whether to also inject fixed-message tasks |
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -65,16 +65,16 @@ description: 创建和管理定时任务
|
||||
}
|
||||
```
|
||||
|
||||
## 任务执行时的上下文
|
||||
## Context inside scheduled task execution
|
||||
|
||||
定时任务的隔离 session 会保留最近几次执行的对话历史,便于做"对比上次"、"延续之前结论"等操作;但为了避免高频任务(如每 5 分钟监控)prompt 越积越长,会按公式自动裁剪:
|
||||
The isolated session for scheduled tasks retains a few recent runs of conversation history, so you can naturally do "compare with last time" or "continue from previous conclusion". To prevent prompts from growing unbounded for high-frequency tasks (e.g. a 5-minute monitor), history is auto-trimmed:
|
||||
|
||||
```
|
||||
scheduler_keep_turns = max(1, agent_max_context_turns / 5)
|
||||
```
|
||||
|
||||
`agent_max_context_turns` 默认为 `20`,所以定时任务每次执行默认带最近 **4 轮**历史。需要更长记忆可调大 `agent_max_context_turns`。
|
||||
`agent_max_context_turns` defaults to `20`, so each scheduled run keeps the most recent **4 turns** of history by default. Increase `agent_max_context_turns` if you need longer memory.
|
||||
|
||||
<Note>
|
||||
群聊场景(飞书 / 企微群机器人 / 钉钉等)下用户的真实 session_id 形如 `user_id:group_id`,与 receiver 不同。创建任务时会自动记录正确的 session_id;老的 `tasks.json` 缺该字段时回落到 receiver,行为与历史版本一致。
|
||||
For group-chat scenarios (Feishu / WeCom group bots / DingTalk, etc.), the user's real `session_id` looks like `user_id:group_id` — different from `receiver`. Scheduler records the correct `session_id` when a task is created. For older `tasks.json` entries missing this field, the runtime falls back to `receiver`, matching legacy behavior.
|
||||
</Note>
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
---
|
||||
title: send - 文件发送
|
||||
description: 向用户发送文件
|
||||
title: send - File Send
|
||||
description: Send files to user
|
||||
---
|
||||
|
||||
向用户发送文件(图片、视频、音频、文档等),当用户明确要求发送/分享文件时使用。
|
||||
Send files to the user (images, videos, audio, documents, etc.), used when the user explicitly requests to send/share a file.
|
||||
|
||||
## 依赖
|
||||
## Dependencies
|
||||
|
||||
无额外依赖,默认可用。
|
||||
No extra dependencies, available by default.
|
||||
|
||||
## 参数
|
||||
## Parameters
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `path` | string | 是 | 文件路径,可以是绝对路径或相对于工作空间的路径 |
|
||||
| `message` | string | 否 | 附带的消息说明 |
|
||||
| `path` | string | Yes | File path, can be absolute or relative to workspace |
|
||||
| `message` | string | No | Accompanying message |
|
||||
|
||||
## 使用场景
|
||||
## Use Cases
|
||||
|
||||
- 将生成的代码或文档发送给用户
|
||||
- 发送截图、图表
|
||||
- 分享下载的文件
|
||||
- Send generated code or documents to the user
|
||||
- Send screenshots, charts
|
||||
- Share downloaded files
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
---
|
||||
title: vision - 图片理解
|
||||
description: 分析图片内容(识别、描述、OCR 等)
|
||||
title: vision - Image Understanding
|
||||
description: Analyze image content (recognition, description, OCR, etc.)
|
||||
---
|
||||
|
||||
使用 Vision API 分析本地图片或图片 URL,支持内容描述、文字提取(OCR)、物体识别等。
|
||||
Analyze local images or image URLs using Vision API. Supports content description, text extraction (OCR), object recognition, and more.
|
||||
|
||||
## 模型选择
|
||||
## Model Selection
|
||||
|
||||
Vision 工具采用多级自动选择 + 自动兜底策略,无需手动配置即可使用:
|
||||
The vision tool uses a multi-level auto-selection strategy with automatic fallback — no manual configuration required:
|
||||
|
||||
1. **主模型** — 优先使用当前配置的主模型进行图像识别(需要是多模态模型)
|
||||
2. **其他已配置模型** — 自动发现已配置 API Key 的其他多模态模型作为备选
|
||||
1. **Main model** — uses the currently configured main model for image recognition (must be a multimodal model)
|
||||
2. **Other configured models** — auto-discovers other multimodal models with configured API keys as alternatives
|
||||
|
||||
如果当前 provider 调用失败,会自动尝试下一个,直到成功或全部失败。
|
||||
If the current provider fails, the tool automatically tries the next one until it succeeds or all fail.
|
||||
|
||||
### 支持的模型
|
||||
### Supported Models
|
||||
|
||||
| 厂商 | 视觉模型 | 说明 |
|
||||
| Provider | Vision Model | Notes |
|
||||
| --- | --- | --- |
|
||||
| OpenAI / 兼容协议 | 使用主模型 | 支持所有 OpenAI 协议兼容的多模态模型 |
|
||||
| 通义千问 (DashScope) | 使用主模型 | 例如 qwen3.6-plus 等 |
|
||||
| Claude | 使用主模型 | Anthropic 原生图像格式 |
|
||||
| Gemini | 使用主模型 | inlineData 格式 |
|
||||
| 豆包 (Doubao) | 使用主模型 | doubao-seed-2-0 系列原生支持 |
|
||||
| Kimi (Moonshot) | 使用主模型 | kimi-k2.6、kimi-k2.5 原生支持 |
|
||||
| 百度千帆 (Qianfan) | 使用主模型 | 默认使用多模态主模型 (如 ernie-5.1),主模型不支持时兜底使用 ernie-4.5-turbo-vl |
|
||||
| 智谱 AI | glm-5v-turbo | 固定使用视觉专用模型 |
|
||||
| MiniMax | MiniMax-Text-01 | 固定使用视觉专用模型 |
|
||||
| OpenAI / Compatible | Main model | All OpenAI-protocol-compatible multimodal models |
|
||||
| Qwen (DashScope) | Main model | e.g. qwen3.6-plus, etc. |
|
||||
| Claude | Main model | Anthropic native image format |
|
||||
| Gemini | Main model | inlineData format |
|
||||
| Doubao | Main model | doubao-seed-2-0 series natively supported |
|
||||
| Kimi (Moonshot) | Main model | kimi-k2.6, kimi-k2.5 natively supported |
|
||||
| ERNIE | Main model | Defaults to the multimodal main model (e.g. `ernie-5.1`); falls back to `ernie-4.5-turbo-vl` when the main model is not multimodal |
|
||||
| ZhipuAI | glm-5v-turbo | Always uses the dedicated vision model |
|
||||
| MiniMax | MiniMax-Text-01 | Always uses the dedicated vision model |
|
||||
|
||||
<Note>
|
||||
智谱和 MiniMax 的文本模型不支持图像理解,因此始终使用对应的视觉专用模型,无需手动指定。
|
||||
ZhipuAI and MiniMax text models do not support image understanding, so their dedicated vision models are always used automatically.
|
||||
</Note>
|
||||
|
||||
> 当 `use_linkai=true` 时,默认使用 LinkAI 的多模态模型进行
|
||||
> When `use_linkai=true`, LinkAI's multimodal model is used by default.
|
||||
|
||||
## 自定义配置
|
||||
## Custom Configuration
|
||||
|
||||
如果希望指定 Vision 使用的模型,可在 `config.json` 中配置,例如:
|
||||
To specify the model used by Vision, configure it in `config.json`, for example:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -48,28 +48,28 @@ Vision 工具采用多级自动选择 + 自动兜底策略,无需手动配置
|
||||
}
|
||||
```
|
||||
|
||||
指定的模型会被**优先使用**,工具会根据模型名自动路由到对应的 provider;若调用失败,会自动 fallback 到其他已配置的 provider。
|
||||
The specified model is **used first**, and the tool automatically routes to the corresponding provider based on the model name; on failure, it falls back to other configured providers.
|
||||
|
||||
大多数情况下无需配置,主模型支持多模态或配置任意一个支持视觉的 API Key 即可自动工作。
|
||||
In most cases no configuration is needed — the tool works automatically as long as the main model supports multimodal input or any vision-capable API key is configured.
|
||||
|
||||
## 参数
|
||||
## Parameters
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `image` | string | 是 | 本地文件路径或 HTTP(S) 图片 URL |
|
||||
| `question` | string | 是 | 对图片提出的问题 |
|
||||
| `image` | string | Yes | Local file path or HTTP(S) image URL |
|
||||
| `question` | string | Yes | Question to ask about the image |
|
||||
|
||||
支持的图片格式:jpg、jpeg、png、gif、webp
|
||||
Supported image formats: jpg, jpeg, png, gif, webp
|
||||
|
||||
|
||||
|
||||
## 使用场景
|
||||
## Use Cases
|
||||
|
||||
- 描述图片中的内容
|
||||
- 提取图片中的文字(OCR)
|
||||
- 识别物体、颜色、场景
|
||||
- 分析截图、文档扫描图片等
|
||||
- Describe image content
|
||||
- Extract text from images (OCR)
|
||||
- Identify objects, colors, scenes
|
||||
- Analyze screenshots and scanned documents
|
||||
|
||||
<Note>
|
||||
超过 1MB 的图片会自动压缩后上传,所有图片(包括远程 URL)会统一转为 base64 传输,确保兼容所有模型后端。
|
||||
Images larger than 1MB are automatically compressed before upload. All images (including remote URLs) are converted to base64 for transmission to ensure compatibility with all model backends.
|
||||
</Note>
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
---
|
||||
title: web_fetch - 网页获取
|
||||
description: 获取网页或文档内容
|
||||
title: web_fetch - Web Fetch
|
||||
description: Fetch web pages and document content
|
||||
---
|
||||
|
||||
获取 HTTP/HTTPS URL 的内容。对网页提取可读文本,对文档文件(PDF、Word、Excel 等)自动下载并解析内容。
|
||||
Fetch the content of an HTTP/HTTPS URL. Web pages are extracted as readable text; document files (PDF, Word, Excel, etc.) are downloaded and parsed automatically.
|
||||
|
||||
## 参数
|
||||
## Parameters
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `url` | string | 是 | HTTP/HTTPS URL(网页或文档链接) |
|
||||
| `url` | string | Yes | HTTP/HTTPS URL (web page or document) |
|
||||
|
||||
## 支持的文件类型
|
||||
## Supported file types
|
||||
|
||||
| 类型 | 格式 |
|
||||
| Type | Formats |
|
||||
| --- | --- |
|
||||
| PDF | `.pdf` |
|
||||
| Word | `.docx` |
|
||||
| 文本 | `.txt`、`.md`、`.csv`、`.log` |
|
||||
| 表格 | `.xls`、`.xlsx` |
|
||||
| 演示文稿 | `.ppt`、`.pptx` |
|
||||
| Text | `.txt`, `.md`, `.csv`, `.log` |
|
||||
| Spreadsheet | `.xls`, `.xlsx` |
|
||||
| Presentation | `.ppt`, `.pptx` |
|
||||
|
||||
## 使用场景
|
||||
## Use cases
|
||||
|
||||
- 获取网页的文本内容
|
||||
- 下载并解析远程文档
|
||||
- 获取 API 响应内容
|
||||
- Extract readable text from a web page
|
||||
- Download and parse remote documents
|
||||
- Inspect API response bodies
|
||||
|
||||
<Note>
|
||||
`web_fetch` 只能获取静态 HTML 内容。如果页面需要 JavaScript 渲染(如 SPA 单页应用),请使用 `browser` 工具。
|
||||
`web_fetch` only retrieves static HTML. For pages that require JavaScript rendering (such as SPAs), use the `browser` tool instead.
|
||||
</Note>
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
---
|
||||
title: web_search - 联网搜索
|
||||
description: 搜索互联网获取实时信息,支持多个搜索厂商
|
||||
title: web_search - Web Search
|
||||
description: Search the internet for real-time information, with support for multiple search providers
|
||||
---
|
||||
|
||||
搜索互联网获取实时信息、新闻、研究等内容。支持博查、百度千帆、智谱、LinkAI 四个后端,配置任意一家即可使用。
|
||||
Search the internet for real-time information, news, research, and more. Supports four backends — Bocha, ERNIE, GLM, and LinkAI — and works once any one of them is configured.
|
||||
|
||||
<Tip>
|
||||
推荐通过 [Web 控制台](/channels/web) 的「模型管理 → 搜索」面板可视化配置厂商与策略,无需手动编辑配置文件。
|
||||
It is recommended to configure providers and routing strategy visually from the "Model Management → Search" panel in the [Web console](/channels/web), without manually editing the configuration file.
|
||||
</Tip>
|
||||
|
||||
## 厂商
|
||||
## Providers
|
||||
|
||||
| 厂商 | 凭证 | 申请入口 |
|
||||
| Provider | Credential | Apply |
|
||||
| --- | --- | --- |
|
||||
| 博查 Bocha | `tools.web_search.bocha_api_key` | [博查开放平台](https://open.bochaai.com/) |
|
||||
| 百度千帆 | 复用 `qianfan_api_key` | [千帆控制台](https://cloud.baidu.com/doc/qianfan/s/2mh4su4uy) |
|
||||
| 智谱 Zhipu | 复用 `zhipu_ai_api_key` | [智谱开放平台](https://docs.bigmodel.cn/cn/guide/tools/web-search) |
|
||||
| LinkAI | 复用 `linkai_api_key` | [LinkAI 控制台](https://link-ai.tech/console/interface) |
|
||||
| Bocha | `tools.web_search.bocha_api_key` | [Bocha Open Platform](https://open.bochaai.com/) |
|
||||
| ERNIE | Reuses `qianfan_api_key` | [Qianfan Console](https://cloud.baidu.com/doc/qianfan/s/2mh4su4uy) |
|
||||
| Zhipu | Reuses `zhipu_ai_api_key` | [Zhipu Open Platform](https://docs.bigmodel.cn/cn/guide/tools/web-search) |
|
||||
| LinkAI | Reuses `linkai_api_key` | [LinkAI Console](https://link-ai.tech/console/interface) |
|
||||
|
||||
除博查需要单独的 `bocha_api_key` 外,其他三家直接复用对应模型的 API Key,配好模型即同时获得搜索能力。
|
||||
Except for Bocha which requires a dedicated `bocha_api_key`, the other three reuse the corresponding model's API key — configuring the model automatically grants search capability.
|
||||
|
||||
## 路由策略
|
||||
## Routing Strategy
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -33,19 +33,19 @@ description: 搜索互联网获取实时信息,支持多个搜索厂商
|
||||
}
|
||||
```
|
||||
|
||||
- `auto`(默认):由 Agent 在已配置的厂商中智能选择,并可在一次任务中多次调用、切换不同厂商以获取更全面的结果;未指定时按 `bocha → qianfan → zhipu → linkai` 顺序兜底。
|
||||
- `fixed`:固定使用 `provider` 指定的厂商;该厂商凭证缺失时自动回落到 auto 顺序。
|
||||
- `auto` (default): the Agent intelligently picks among configured providers and may call multiple providers in a single task to gather more comprehensive results; when none is specified, falls back through `bocha → qianfan → zhipu → linkai`.
|
||||
- `fixed`: always use the provider specified in `provider`; falls back to the auto order if that provider's credentials are missing.
|
||||
|
||||
## 工具参数
|
||||
## Tool Parameters
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `query` | string | 是 | 搜索关键词 |
|
||||
| `count` | integer | 否 | 返回结果数量(1–50,默认 10) |
|
||||
| `freshness` | string | 否 | 时间范围:`noLimit`(默认)、`oneDay`、`oneWeek`、`oneMonth`、`oneYear`,或日期范围如 `2025-01-01..2025-02-01` |
|
||||
| `summary` | boolean | 否 | 是否返回页面摘要(默认 false) |
|
||||
| `provider` | string | 否 | `auto` 策略下配置了多个厂商时可见,用于单次切换厂商 |
|
||||
| `query` | string | Yes | Search keywords |
|
||||
| `count` | integer | No | Number of results (1–50, default 10) |
|
||||
| `freshness` | string | No | Time range: `noLimit` (default), `oneDay`, `oneWeek`, `oneMonth`, `oneYear`, or date range like `2025-01-01..2025-02-01` |
|
||||
| `summary` | boolean | No | Whether to return page summaries (default false) |
|
||||
| `provider` | string | No | Available when multiple providers are configured under the `auto` strategy; used to switch provider for a single call |
|
||||
|
||||
<Note>
|
||||
四家凭证均未配置时,该工具不会注册到 Agent。
|
||||
If none of the four credentials are configured, this tool is not registered with the Agent.
|
||||
</Note>
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
---
|
||||
title: write - 文件写入
|
||||
description: 创建或覆盖写入文件
|
||||
title: write - File Write
|
||||
description: Create or overwrite files
|
||||
---
|
||||
|
||||
写入内容到文件。文件不存在则自动创建,已存在则覆盖。自动创建父目录。
|
||||
Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.
|
||||
|
||||
## 依赖
|
||||
## Dependencies
|
||||
|
||||
无额外依赖,默认可用。
|
||||
No extra dependencies, available by default.
|
||||
|
||||
## 参数
|
||||
## Parameters
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `path` | string | 是 | 文件路径 |
|
||||
| `content` | string | 是 | 要写入的内容 |
|
||||
| `path` | string | Yes | File path |
|
||||
| `content` | string | Yes | Content to write |
|
||||
|
||||
## 使用场景
|
||||
## Use Cases
|
||||
|
||||
- 创建新的代码文件或脚本
|
||||
- 生成配置文件
|
||||
- 保存处理结果
|
||||
- Create new code files or scripts
|
||||
- Generate configuration files
|
||||
- Save processing results
|
||||
|
||||
<Note>
|
||||
单次写入不应超过 10KB。对于大文件,建议先创建骨架,再使用 edit 工具分块添加内容。
|
||||
Single writes should not exceed 10KB. For large files, create a skeleton first, then use the edit tool to add content in chunks.
|
||||
</Note>
|
||||
|
||||
Reference in New Issue
Block a user