examples/macos/DialogFlow/README.md
A Swift command-line assistant that walks you through setting up wifi by voice,
mirroring the web dialog-flow demo and the Python dialog_flow.py script.
DialogFlow owns the speech-to-text, intent, and text-to-speech engines, so the
interesting part of the program is the flow itself — ordinary async code that
asks a question and gets an answer back:
let ssid = try await d.ask("What's the name of your wifi network?")
guard try await d.confirm("I heard \(ssid). Is that right?") else { ... }
cd examples/macos/DialogFlow
swift build
# Speak to it (asks for microphone access the first time)
swift run DialogFlow
# Type the answers instead, for machines without a microphone
swift run DialogFlow --text
Say (or type) "set up wifi" to start the flow. Two commands work at any
point without being registered, because DialogFlow provides them:
~/Library/Caches/MoonshineModels/ and reused afterwards. The first run
fetches roughly a gigabyte, so give it a minute.