mcpField
A
agents

agents

github.com/calesthioエージェントワークフロー73.0k1.1k 回インストール1 日前に更新
リポジトリ

agents について

ElevenLabs Agents Platformは、音声AIエージェントの構築と管理に使うツールキットです。CLIとSDKに加え、LLMやツールの設定、Webサイトへの埋め込み、発信通話に対応します。

主な機能

  1. 01CLIでのエージェント作成と管理
  2. 02Python・JavaScript SDK対応
  3. 03複数LLMプロバイダーの設定
  4. 04Webhook・クライアント・システムツールの追加
  5. 05Webサイトへのエージェント埋め込み
  6. 06Twilio経由の発信通話

活用シーン

  1. 01CLIテンプレートから音声エージェントを作成
  2. 02Webアプリでエージェントのセッションを接続
  3. 03API呼び出しやブラウザー操作をエージェントに追加
  4. 04エージェントから発信通話を実行

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/calesthio/openmontage --skill agents

インストール後、Claude Code で/agentsを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

references/
agent-configuration.md
client-tools.md
installation.md
outbound-calls.md
widget-embedding.md

詳細

ElevenLabs エージェントプラットフォーム

自然な会話、複数の LLM プロバイダー、カスタムツール、簡単な Web 埋め込みに対応した音声 AI エージェントを構築できます。

セットアップ: CLI と SDK のセットアップについては、インストールガイドを参照してください。

CLI でクイックスタート

エージェントの作成と管理には、ElevenLabs CLI の使用をおすすめします。

# Install CLI and authenticate
npm install -g @elevenlabs/cli
elevenlabs auth login

# Initialize project and create an agent
elevenlabs agents init
elevenlabs agents add "My Assistant" --template complete

# Push to ElevenLabs platform
elevenlabs agents push

利用可能なテンプレート: complete、minimal、voice-only、text-only、customer-service、assistant

Python
from elevenlabs import ElevenLabs

client = ElevenLabs()

agent = client.conversational_ai.agents.create(
    name="My Assistant",
    enable_versioning=True,
    conversation_config={
        "agent": {
            "first_message": "Hello! How can I help?",
            "language": "en",
            "prompt": {
                "prompt": "You are a helpful assistant. Be concise and friendly.",
                "llm": "gemini-2.0-flash",
                "temperature": 0.7
            }
        },
        "tts": {"voice_id": "JBFqnCBsd6RMkjVDRZzb"}
    }
)
JavaScript
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
const client = new ElevenLabsClient();

const agent = await client.conversationalAi.agents.create({
  name: "My Assistant",
  enableVersioning: true,
  conversationConfig: {
    agent: {
      firstMessage: "Hello! How can I help?",
      language: "en",
      prompt: {
        prompt: "You are a helpful assistant.",
        llm: "gemini-2.0-flash",
        temperature: 0.7
      }
    },
    tts: { voiceId: "JBFqnCBsd6RMkjVDRZzb" }
  }
});
cURL
curl -X POST "https://api.elevenlabs.io/v1/convai/agents/create?enable_versioning=true" \
  -H "xi-api-key: $ELEVENLABS_API_KEY" -H "Content-Type: application/json" \
  -d '{"name": "My Assistant", "conversation_config": {"agent": {"first_message": "Hello!", "language": "en", "prompt": {"prompt": "You are helpful.", "llm": "gemini-2.0-flash"}}, "tts": {"voice_id": "JBFqnCBsd6RMkjVDRZzb"}}}'

会話の開始

サーバー側(Python): クライアント接続用の署名付き URL を取得します。

signed_url = client.conversational_ai.conversations.get_signed_url(
    agent_id="your-agent-id",
    environment="staging",
)

クライアント側(JavaScript):

import { Conversation } from "@elevenlabs/client";

const conversation = await Conversation.startSession({
  agentId: "your-agent-id",
  environment: "staging",
  onMessage: (msg) => console.log("Agent:", msg.message),
  onUserTranscript: (t) => console.log("User:", t.message),
  onError: (e) => console.error(e)
});

React フック:

import { useConversation } from "@elevenlabs/react";

const conversation = useConversation({ onMessage: (msg) => console.log(msg) });
// Get a signed URL for the target environment from your backend, then:
await conversation.startSession({ signedUrl: token });

設定

プロバイダーモデル
OpenAIgpt-5、gpt-5-mini、gpt-5-nano、gpt-4.1、gpt-4.1-mini、gpt-4.1-nano、gpt-4o、gpt-4o-mini、gpt-4-turbo
Anthropicclaude-sonnet-4-6、claude-sonnet-4-5、claude-sonnet-4、claude-haiku-4-5、claude-3-7-sonnet、claude-3-5-sonnet、claude-3-haiku
Googlegemini-3.1-flash-lite-preview、gemini-3-pro-preview、gemini-3-flash-preview、gemini-2.5-flash、gemini-2.5-flash-lite、gemini-2.0-flash、gemini-2.0-flash-lite
ElevenLabsglm-45-air-fp8、qwen3-30b-a3b、gpt-oss-120b
カスタムcustom-llm(独自のエンドポイントを使用)

GET /v1/convai/llm/list を使用して、廃止状況、トークン数/コンテキストの上限、画像入力のサポートなどの機能フラグを含む、現在のモデルカタログを確認できます。

人気の音声: JBFqnCBsd6RMkjVDRZzb(George)、EXAVITQu4vr4xnSDxMaL(Sarah)、onwK4e9ZLuTAKqWW03F9(Daniel)、XB0fDUnXU5powFXDhCwa(Charlotte)

応答の積極性: patient(ユーザーが話し終えるまで長く待機)、normal、eager(すばやく応答)

すべてのオプションについては、エージェント設定を参照してください。

ツール

Webhook、クライアント、または組み込みのシステムツールを使ってエージェントを拡張できます。ツールは conversation_config.agent.prompt 内で定義します。

ワークスペースの環境変数を使って、環境ごとにサーバーツールの URL、ヘッダー、認証接続を設定できます。また、{{system__conversation_history}} などのランタイムシステム変数を使い、必要に応じて会話の全コンテキストをツール呼び出しに渡せます。

"prompt": {
    "prompt": "You are a helpful assistant that can check the weather.",
    "llm": "gemini-2.0-flash",
    "tools": [
        # Webhook: server-side API call
        {"type": "webhook", "name": "get_weather", "description": "Get weather",
         "api_schema": {"url": "https://api.example.com/weather", "method": "POST",
             "request_body_schema": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}}},
        # Client: runs in the browser
        {"type": "client", "name": "show_product", "description": "Display a product",
         "parameters": {"type": "object", "properties": {"productId": {"type": "string"}}, "required": ["productId"]}}
    ],
    "built_in_tools": {
        "end_call": {},
        "transfer_to_number": {"transfers": [{"transfer_destination": {"type": "phone", "phone_number": "+1234567890"}, "condition": "User asks for human support"}]}
    }
}

クライアントツールはブラウザーで実行されます。

clientTools: {
  show_product: async ({ productId }) => {
    document.getElementById("product").src = `/products/${productId}`;
    return { success: true };
  }
}

詳細なドキュメントについては、クライアントツールのリファレンスを参照してください。

ウィジェットの埋め込み

<elevenlabs-convai agent-id="your-agent-id"></elevenlabs-convai>
<script src="https://unpkg.com/@elevenlabs/convai-widget-embed" async type="text/javascript"></script>

属性を使ってカスタマイズできます:avatar-image-url、action-text、start-call-text、end-call-text。

すべてのオプションについては、ウィジェット埋め込みリファレンスを参照してください。

発信通話

Twilio 連携を使って、エージェントから電話を発信できます。

Python
response = client.conversational_ai.twilio.outbound_call(
    agent_id="your-agent-id",
    agent_phone_number_id="your-phone-number-id",
    to_number="+1234567890",
    call_recording_enabled=True
)
print(f"Call initiated: {response.conversation_id}")
JavaScript
const response = await client.conversationalAi.twilio.outboundCall({
  agentId: "your-agent-id",
  agentPhoneNumberId: "your-phone-number-id",
  toNumber: "+1234567890",
  callRecordingEnabled: true,
});
cURL
curl -X POST "https://api.elevenlabs.io/v1/convai/twilio/outbound-call" \
  -H "xi-api-key: $ELEVENLABS_API_KEY" -H "Content-Type: application/json" \
  -d '{"agent_id": "your-agent-id", "agent_phone_number_id": "your-phone-number-id", "to_number": "+1234567890", "call_recording_enabled": true}'

設定の上書きと動的変数については、発信通話リファレンスを参照してください。

エージェントの管理

CLI を使用(推奨)
# List agents and check status
elevenlabs agents list
elevenlabs agents status

# Import agents from platform to local config
elevenlabs agents pull                      # Import all agents
elevenlabs agents pull --agent <agent-id>   # Import specific agent

# Push local changes to platform
elevenlabs agents push              # Upload configurations
elevenlabs agents push --dry-run    # Preview changes first

# Add tools
elevenlabs tools add-webhook "Weather API"
elevenlabs tools add-client "UI Tool"
プロジェクト構成

CLI はエージェントを管理するためのプロジェクト構成を作成します。

your_project/
├── agents.json       # Agent definitions
├── tools.json        # Tool configurations
├── tests.json        # Test configurations
├── agent_configs/    # Individual agent configs
├── tool_configs/     # Individual tool configs
└── test_configs/     # Individual test configs
SDK の例
# List
agents = client.conversational_ai.agents.list()

# Get
agent = client.conversational_ai.agents.get(agent_id="your-agent-id")

# Update (partial - only include fields to change)
client.conversational_ai.agents.update(agent_id="your-agent-id", name="New Name")
client.conversational_ai.agents.update(agent_id="your-agent-id",
    conversation_config={
        "agent": {"prompt": {"prompt": "New instructions", "llm": "claude-sonnet-4"}}
    })

# Delete
client.conversational_ai.agents.delete(agent_id="your-agent-id")

すべての設定オプションと SDK の例については、エージェント設定を参照してください。

エラー処理

try:
    agent = client.conversational_ai.agents.create(...)
except Exception as e:
    print(f"API error: {e}")

よくあるエラー:401(キーが無効)、404(見つかりません)、422(設定が無効)、429(レート制限)

リファレンス

コメント