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

from signalwire import SWMLService, SWMLBuilder
service = SWMLService(name="demo")
builder = SWMLBuilder(service)
# Build first document
doc1 = builder.answer().hangup().build()
print(doc1)
# Reset and build a different document
builder.reset()
doc2 = builder.answer().play(url="say:Goodbye").hangup().build()
print(doc2)