Simple basic agent using Twilio - bolna-ai/bolna GitHub Wiki

  1. Create an Agent via http://localhost:5001/agent
Agent Payload
{
    "agent_config": {
        "agent_name": "Alfred",
        "agent_type": "other",
        "agent_welcome_message": "How are you doing Bruce?",
        "tasks": [
            {
                "task_type": "conversation",
                "toolchain": {
                    "execution": "parallel",
                    "pipelines": [
                        [
                            "transcriber",
                            "llm",
                            "synthesizer"
                        ]
                    ]
                },
                "tools_config": {
                    "input": {
                        "format": "pcm",
                        "provider": "twilio"
                    },
                    "llm_agent": {
                        "agent_type": "simple_llm_agent",
                        "agent_flow_type": "streaming",
                        "routes": null,
                        "llm_config": {
                            "agent_flow_type": "streaming",
                            "provider": "openai",
                            "request_json": true,
                            "model": "gpt-3.5-turbo-16k"
                        }
                    },
                    "output": {
                        "format": "pcm",
                        "provider": "twilio"
                    },
                    "synthesizer": {
                        "audio_format": "wav",
                        "provider": "elevenlabs",
                        "stream": true,
                        "provider_config": {
                            "voice": "Daniel",
                            "model": "eleven_turbo_v2_5",
                            "voice_id": "onwK4e9ZLuTAKqWW03F9"
                        },
                        "buffer_size": 100.0
                    },
                    "transcriber": {
                        "encoding": "linear16",
                        "language": "en",
                        "provider": "deepgram",
                        "stream": true
                    }
                },
                "task_config": {
                    "hangup_after_silence": 30.0
                }
            }
        ]
    },
    "agent_prompts": {
        "task_1": {
            "system_prompt": "Why Do We Fall, Sir? So That We Can Learn To Pick Ourselves Up."
        }
    }
}
  1. The response of the previous API will return a uuid as the agent_id. Use this agent_id to initiate a call via the telephony server running on 8001 port (for Twilio) or 8002 port (for Plivo) at http://localhost:8001/call
Call Payload
``` { "agent_id": "4c19700b-227c-4c2d-8bgf-42dfe4b240fc", "recipient_phone_number": "+19876543210", } ```
⚠️ **GitHub.com Fallback** ⚠️