# clawdia-bridge **Repository Path**: judeli/clawdia-bridge ## Basic Information - **Project Name**: clawdia-bridge - **Description**: 语音与电话 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-04 - **Last Updated**: 2026-06-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Clawdia Bridge HTTP bridge that connects **Clawdia** (Vapi voice assistant) to **Clawdius** (AI assistant running on Clawdis). ## How It Works ``` You (phone call) ↓ Clawdia (Vapi voice AI) ↓ POST /ask (tool call) Clawdia Bridge ↓ WebSocket to Gateway Clawdius (processes request) ↓ returns response Clawdia Bridge ↓ returns to Vapi Clawdia ↓ speaks response You ``` ## Quick Start ```bash # Clone git clone https://github.com/alejandroOPI/clawdia-bridge.git cd clawdia-bridge # Install dependencies npm install # Run npm start ``` ## Environment Variables | Variable | Default | Description | |----------|---------|-------------| | `BRIDGE_PORT` | `3847` | Port to listen on | | `GATEWAY_URL` | `ws://127.0.0.1:18789` | Clawdis Gateway WebSocket URL | ## API Endpoints ### POST /ask Clawdia calls this endpoint to ask Clawdius a question. **Vapi Tool Call Format:** ```json { "message": { "toolCalls": [{ "id": "tool-call-id", "function": { "name": "ask_clawdius", "arguments": "{\"question\": \"What time is it?\"}" } }] } } ``` **Response:** ```json { "results": [{ "toolCallId": "tool-call-id", "result": "It's 6pm Mexico City time." }] } ``` **Direct Call Format (for testing):** ```json { "question": "What time is it?" } ``` **Response:** ```json { "answer": "It's 6pm Mexico City time." } ``` ### GET /health Health check endpoint. ```json { "status": "ok", "mode": "gateway-ws" } ``` ## Vapi Configuration ### 1. Create Assistant "Clawdia" In the Vapi dashboard, create an assistant with: - **Name:** Clawdia - **Voice:** Female voice (e.g., Lily from Vapi) - **Model:** Claude or GPT - **System Prompt:** ``` Eres Clawdia, la asistente de voz de Alejandro. Eres amable, directa y eficiente. REGLAS: - Hablas español principalmente - Se breve en tus respuestas - esto es una llamada telefónica - Si necesitas información (calendario, emails, clima, etc), usa ask_clawdius - Clawdius es otro asistente que tiene acceso a toda la información de Alejandro ``` ### 2. Add Tool Add this tool to the assistant: ```json { "type": "function", "function": { "name": "ask_clawdius", "description": "Pregunta a Clawdius por información o para ejecutar una acción.", "parameters": { "type": "object", "properties": { "question": { "type": "string", "description": "La pregunta o solicitud para Clawdius" } }, "required": ["question"] } }, "server": { "url": "https://your-server.com/ask" } } ``` ### 3. Assign Phone Number Assign a Vapi phone number to the Clawdia assistant. ## Exposing to Internet ### Tailscale Funnel (Recommended) ```bash npm start tailscale funnel 3847 ``` Your URL: `https://your-machine.tailXXXX.ts.net/` ### ngrok ```bash npm start ngrok http 3847 ``` ## Architecture The bridge connects to the Clawdis Gateway via WebSocket and uses the `agent` method to process requests. This means: 1. Questions go through the same pipeline as WhatsApp/Telegram messages 2. Clawdius has access to all skills (calendar, email, weather, etc.) 3. Responses are generated by the same AI that handles other channels ### Why WebSocket? - **Direct connection** - No polling, no intermediate services - **Full access** - Same capabilities as other messaging channels - **Fast** - Sub-second latency for most responses ## Testing ```bash # Health check curl http://localhost:3847/health # Direct question curl -X POST http://localhost:3847/ask \ -H "Content-Type: application/json" \ -d '{"question": "What time is it?"}' ``` ## License MIT