Relay To Agent技能使用说明
2026-03-30
新闻来源:网淘吧
围观:14
电脑广告
手机广告
转发至代理
向任何兼容OpenAI的终端节点上的AI代理发送消息。支持Connect Chat、OpenRouter、LiteLLM、vLLM、Ollama以及任何实现了Chat Completions API的服务。
列出可用代理
node {baseDir}/scripts/relay.mjs --list
向代理发送消息
node {baseDir}/scripts/relay.mjs --agent linkedin-alchemist "Transform this article into a LinkedIn post"
多轮对话
# First message
node {baseDir}/scripts/relay.mjs --agent connect-flow-ai "Analyze our latest campaign"
# Follow-up (same session, agent remembers context)
node {baseDir}/scripts/relay.mjs --agent connect-flow-ai "Compare with last month"
重置会话
node {baseDir}/scripts/relay.mjs --agent linkedin-alchemist --reset "Start fresh with this article..."
选项
| 标识 | 描述 | 默认值 |
|---|---|---|
--代理 ID | 目标代理标识符 | (必需) |
--重置 | 发送前重置对话 | 关闭 |
--列表 | 列出可用代理 | — |
--会话 ID | 自定义会话标识符 | 默认 |
--json | 原始JSON输出 | 关闭 |
配置
agents.json
在以下文件中配置代理和端点{baseDir}/agents.json:

{
"baseUrl": "https://api.example.com/v1",
"agents": [
{
"id": "my-agent",
"name": "My Agent",
"description": "What this agent does",
"model": "model-id-on-the-api"
}
]
}
环境变量
export RELAY_API_KEY="sk-..." # API key (required)
export RELAY_BASE_URL="https://..." # Override base URL from config
export RELAY_CONFIG="/path/to/agents.json" # Custom config path
兼容服务
- Connect Chat—
api.connectchat.ai/api - OpenRouter—
openrouter.ai/api/v1 - LiteLLM—
localhost:4000/v1 - vLLM—
localhost:8000/v1 - Ollama—
localhost:11434/v1 - 任何 OpenAI 兼容的 API
会话管理
会话存储在本地位置:~/.cache/relay-to-agent/sessions/每个代理+会话组合最多保留50条消息。使用--session参数可与同一代理进行并行对话。
文章底部电脑广告
手机广告位-内容正文底部


微信扫一扫,打赏作者吧~