Server SDKs
Build AI agents, control calls, send messages, and more
get_document
Get the current SWML document as a Python dictionary. The returned structure follows the standard SWML format with version and sections keys.
version
sections
dict[str, Any] — The current SWML document. Structure:
dict[str, Any]
1{2 "version": "1.0.0",3 "sections": {4 "main": [5 {"answer": {}},6 {"ai": {...}}7 ]8 }9}
1from signalwire import SWMLService23service = SWMLService(name="my-service")4service.add_verb("answer", {})5service.add_verb("play", {"url": "https://example.com/audio.mp3"})67doc = service.get_document()8print(doc["version"]) # "1.0.0"9print(len(doc["sections"]["main"])) # 2