Agents, quick test, translation and TTS
Create and update receptionists, run Quick test conversation turns, pre-warm audio responses, translate text and synthesize MP3 speech.
Agents
Creates a new receptionist agent. Agents are listed via GET /api/bootstrap.
| Field | Type | Default / Rules |
|---|---|---|
name | string | Required, 1 to 80 chars. |
role | string | Default "AI receptionist". |
languages | string[] | Default ["Hindi", "English"]. Non-empty on patch. |
voice | string | Default "neural:hi-IN-SwaraNeural". |
greeting | string | Default "". |
greeting_language | string | Default "Hindi". |
tone | string | "casual" (default) or "formal". |
instructions, transfer_number | string | Default "". |
status | string | "draft" (default), "live", or "paused". |
curl -s -b cookies.txt -X POST https://dhvani.aware.co.in/api/agents \
-H "Content-Type: application/json" \
-d '{"name":"Clinic Desk","languages":["Hindi","English"],"tone":"formal"}'
Partially updates only the submitted fields. Returns 404 if missing or 422 on invalid status, tone or empty required fields.
Deletes the agent. Existing call logs are preserved. Pass ?keep_notes=true to retain agent-specific knowledge notes for all agents instead of deleting them.
Quick test and pre-warming
Evaluates one caller turn in Quick test mode using the agent's greeting, tone and knowledge notes, localized to language.
| Request field | Type | Notes |
|---|---|---|
message | string | Required, 1 to 2000 chars. |
language | string | Target reply language, default "English". |
greeting | boolean | If true, returns the localized opening greeting. |
curl -s -b cookies.txt -X POST https://dhvani.aware.co.in/api/agents/agent-front-desk/test \
-H "Content-Type: application/json" \
-d '{"message":"What are your AC inspection charges?","language":"Hindi"}'
{
"reply": "...",
"source": "Services and pricing",
"source_language": "English",
"mode": "retrieval",
"translated": true,
"language": "Hindi",
"tone": "casual"
}
Pre-warms translations and voice audio for the agent's greeting, top knowledge notes and fallback responses in the background so browser test playback starts immediately.
{"language": "Hindi", "voice": "hi-IN-SwaraNeural"}
Translation and text-to-speech
Translates text (1 to 5000 chars) into language (Hinglish returns unchanged). Returns translation_unavailable: true if translation could not be completed.
{"text": "We open at 9 AM.", "language": "Tamil", "source_language": "English"}
{"text": "...", "language": "Tamil", "translated": true, "translation_unavailable": false}
Returns the 20 supported neural voices across 10 locales plus "browser_only": ["Odia"].
Synthesizes MP3 audio for text (1 to 1200 chars) and voice (must be a valid neural voice ID; otherwise 422).
Prepares an utterance for streamed playback and returns its stream URL.
{"id": "a1b2c3...", "url": "/api/tts/stream/a1b2c3...", "cached": false}
Streams MP3 audio for a key returned by /api/tts/prepare (`404` if unknown).