Skip to content

feat(ines/vapi): VapiClient + VapiAssistantService + VapiCallOutbound

idevx1 a demandé de fusionner feature/ines-backend-vapi vers develop

Vapi Backend — identique VoxAI

VapiClient

  • WebClient dédié (Authorization: Bearer {api-key})
  • Assistants: create/update/delete/get
  • Tools: create/update/delete
  • Calls: createCall/getCall/listCalls
  • PhoneNumbers: list/import/update, createCredential

VapiAssistantService

  • syncAgentToVapi(PhoneAgent) → crée ou met à jour l'assistant Vapi
  • buildSystemPrompt: date + prompt + questions qualification + objections + clôture + instructions forwarding multi-destinations
  • ensureForwardingTransferTool: tool transferCall en bibliothèque Vapi
    • warm-transfer-with-message + fallbackPlan
    • Pas de paramètre destination (évite hallucinations LLM)
  • Auto-sync à l'activation de l'agent

VapiCallOutboundService

  • initiateOutboundCall(campaign, prospect, agent, vapiNumberId) — REQUIRES_NEW
  • Metadata: userUid, agentUid, prospectUid, campaignUid → récupérés dans webhook
  • testCall sans campagne

VapiWebhookService enrichi

  • updateProspectStatusFromCallResult → extrait prospectUid des metadata Vapi → met à jour ProspectStatus + lastCallDate + callCount

Config

  • VapiConfig: app.vapi.api-key, base-url, webhook-secret, webhook-url
  • WebClientConfig: bean vapiWebClient avec header Authorization: Bearer

Rapports de requête de fusion