Реалізація Voice AI Agent (голосовий AI-агент для дзвінків)

Проектуємо та впроваджуємо системи штучного інтелекту: від прототипу до production-ready рішення. Наша команда поєднує експертизу в машинному навчанні, дата-інжинірингу та MLOps, щоб AI працював не в лабораторії, а в реальному бізнесі.
Показано 1 з 1Усі 1566 послуг
Реалізація Voice AI Agent (голосовий AI-агент для дзвінків)
Складний
від 1 тижня до 3 місяців
Часті запитання

Напрямки AI-розробки

Етапи розробки AI-рішення

Останні роботи

  • image_website-b2b-advance_0.webp
    Розробка сайту компанії B2B ADVANCE
    1284
  • image_web-applications_feedme_466_0.webp
    Розробка веб-додатків для компанії FEEDME
    1196
  • image_websites_belfingroup_462_0.webp
    Розробка веб-сайту для компанії БЕЛФІНГРУП
    901
  • image_ecommerce_furnoro_435_0.webp
    Розробка інтернет магазину для компанії FURNORO
    1119
  • image_logo-advance_0.webp
    Розробка логотипу компанії B2B Advance
    586
  • image_crm_enviok_479_0.webp
    Розробка веб-додатків для компанії Enviok
    853

Реалізація Voice AI Agent (голосовий AI-агент для дзвінків) Voice AI Agent - автономний агент, який веде повноцінні телефонні переговори: розуміє контекст, ставить уточнюючі питання, приймає рішення, викликає інструменти (CRM, бази даних) і завершує діалог з результатом. ### Архітектура Voice AI Agent```

Telephony (Twilio/Voximplant) ↓ WebSocket Bridge ↓ STT (Deepgram/Whisper) ↓ Conversation Manager ├── State Machine ├── LLM (GPT-4o) ├── Tool Registry (CRM, DB, APIs) └── Context Window ↓ TTS (ElevenLabs/OpenAI) ↓ Audio Back to Call ### Conversation Manager з інструментамиpython from openai import AsyncOpenAI from dataclasses import dataclass, field import json

client = AsyncOpenAI()

@dataclass class AgentState: call_id: str history: list = field(default_factory=list) collected_data: dict = field(default_factory=dict) current_intent: str = None

class VoiceAgent: def init(self): self.tools = [ { "type": "function", "function": { "name": "lookup_order", "description": "Найти заказ клиента по номеру телефона или ID заказа", "parameters": { "type": "object", "properties": { "phone": {"type": "string"}, "order_id": {"type": "string"} } } } }, { "type": "function", "function": { "name": "reschedule_delivery", "description": "Перенести доставку на другую дату", "parameters": { "type": "object", "properties": { "order_id": {"type": "string"}, "new_date": {"type": "string", "description": "YYYY-MM-DD"} }, "required": ["order_id", "new_date"] } } } ]

async def process_turn(self, state: AgentState, user_text: str) -> str:
    state.history.append({"role": "user", "content": user_text})

    response = await client.chat.completions.create(
        model="gpt-4o",
        messages=[
            {"role": "system", "content": self._get_system_prompt()},
            *state.history
        ],
        tools=self.tools,
        tool_choice="auto"
    )

    message = response.choices[0].message

    # Обработка function calls
    if message.tool_calls:
        tool_results = await self._execute_tools(message.tool_calls)
        state.history.append(message)
        state.history.extend(tool_results)

        # Повторный вызов для финального ответа
        final = await client.chat.completions.create(
            model="gpt-4o",
            messages=[{"role": "system", "content": self._get_system_prompt()}]
                      + state.history
        )
        reply = final.choices[0].message.content
    else:
        reply = message.content

    state.history.append({"role": "assistant", "content": reply})
    return reply

### Інтеграція з Twiliopython from twilio.rest import Client from twilio.twiml.voice_response import VoiceResponse, Start, Stream

twilio_client = Client(TWILIO_SID, TWILIO_AUTH)

def handle_incoming_call(call_sid: str, ws_url: str) -> str: response = VoiceResponse() start = Start() start.stream(url=f'wss://api.example.com/stream/{call_sid}') response.append(start) response.say("Добро пожаловать! Как я могу помочь?", voice="alice", language="ru-RU") response.pause(length=60) return str(response)