diff --git a/rest/docs/calling.md b/rest/docs/calling.md index 903c3bc7..16a89924 100644 --- a/rest/docs/calling.md +++ b/rest/docs/calling.md @@ -208,9 +208,13 @@ client.calling.ai_stop(call_id, control_id="ai-1") ## Live Transcribe & Translate +`action` is an object keyed by the phase (`start`/`summarize`), with the phase's +parameters inside it — or the literal string `"stop"`: + ```python -client.calling.live_transcribe(call_id, action="start", lang="en") -client.calling.live_translate(call_id, action="start", from_lang="en", to_lang="es") +client.calling.live_transcribe(call_id, action={"start": {"lang": "en", "webhook": "https://example.com/transcripts"}}) +client.calling.live_transcribe(call_id, action="stop") +client.calling.live_translate(call_id, action={"start": {"from_lang": "en", "to_lang": "es"}}) ``` ## Fax diff --git a/tests/unit/core/test_swml_service_swaig.py b/tests/unit/core/test_swml_service_swaig.py index ba0ea9ee..5de231bf 100644 --- a/tests/unit/core/test_swml_service_swaig.py +++ b/tests/unit/core/test_swml_service_swaig.py @@ -243,13 +243,14 @@ def test_can_emit_ai_sidecar_verb(self) -> None: svc.add_section("main") ok = svc.add_verb_to_section("main", "answer", {}) assert ok - # ai_sidecar isn't in the live SWML schema yet — bypass via raw doc. - # Once the schema lands, callers will use add_verb_to_section directly. - svc._current_document["sections"]["main"].append({"ai_sidecar": { + # ai_sidecar landed in the bundled schema (4645d48), so the supported + # path works — and routes the verb through schema validation. + ok = svc.add_verb_to_section("main", "ai_sidecar", { "prompt": "real-time copilot", "lang": "en-US", "direction": ["remote-caller", "local-caller"], - }}) + }) + assert ok rendered = json.loads(svc.render_document()) verbs = [list(v.keys())[0] for v in rendered["sections"]["main"]] assert "answer" in verbs