跳至主要内容
小龙虾小龙虾AI
🤖

Relay To Agent

Relay messages to AI agents on any OpenAI-compatible API. Supports multi-turn conversations with session management. List agents, send messages, reset sessions.

下载2.2k
星标5
版本0.0.1
AI 智能体
安全通过
⚙️脚本

技能说明


name: relay-to-agent description: "Relay messages to AI agents on any OpenAI-compatible API. Supports multi-turn conversations with session management. List agents, send messages, reset sessions." homepage: https://platform.openai.com/docs/api-reference/chat metadata: {"clawdbot":{"emoji":"🤖","requires":{"bins":["node"]},"primaryEnv":"RELAY_API_KEY"}}

Relay To Agent

Send messages to AI agents on any OpenAI-compatible endpoint. Works with Connect Chat, OpenRouter, LiteLLM, vLLM, Ollama, and any service implementing the Chat Completions API.

List available agents

node {baseDir}/scripts/relay.mjs --list

Send a message to an agent

node {baseDir}/scripts/relay.mjs --agent linkedin-alchemist "Transform this article into a LinkedIn post"

Multi-turn conversation

# 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"

Reset session

node {baseDir}/scripts/relay.mjs --agent linkedin-alchemist --reset "Start fresh with this article..."

Options

FlagDescriptionDefault
--agent IDTarget agent identifier(required)
--resetReset conversation before sendingoff
--listList available agents
--session IDCustom session identifierdefault
--jsonRaw JSON outputoff

Configuration

agents.json

Configure agents and endpoint in {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"
    }
  ]
}

Environment variables

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

Compatible Services

  • Connect Chatapi.connectchat.ai/api
  • OpenRouteropenrouter.ai/api/v1
  • LiteLLMlocalhost:4000/v1
  • vLLMlocalhost:8000/v1
  • Ollamalocalhost:11434/v1
  • Any OpenAI-compatible API

Session Management

Sessions are stored locally at ~/.cache/relay-to-agent/sessions/. Each agent+session combination keeps up to 50 messages. Use --session for parallel conversations with the same agent.

如何使用「Relay To Agent」?

  1. 打开小龙虾AI(Web 或 iOS App)
  2. 点击上方「立即使用」按钮,或在对话框中输入任务描述
  3. 小龙虾AI 会自动匹配并调用「Relay To Agent」技能完成任务
  4. 结果即时呈现,支持继续对话优化

相关技能