reset

View as MarkdownOpen in Claude

Reset the document to an empty state and return the builder for continued chaining. Delegates to SWMLService.reset_document().

Returns

Self — The builder instance for method chaining.

Example

1from signalwire import SWMLService, SWMLBuilder
2
3service = SWMLService(name="demo")
4builder = SWMLBuilder(service)
5
6# Build first document
7doc1 = builder.answer().hangup().build()
8print(doc1)
9
10# Reset and build a different document
11builder.reset()
12doc2 = builder.answer().play(url="say:Goodbye").hangup().build()
13print(doc2)