Skip to main content

Installation

Python 3.8 or later.
PyAudio needs PortAudio: brew install portaudio (macOS) or sudo apt install portaudio19-dev (Debian/Ubuntu). Without local audio, pip install lokutor is enough.

TTS to a WAV file

Use play=True instead to hear it through your speakers.

Voice Agent

Events

client.on(event, callback) registers a callback directly — it is not a decorator (it takes the callback as its second argument and returns the client, not a decorator function), so @client.on('transcription') above a def will raise a TypeError. Call it like this instead:
Or, equivalently, pass the callbacks directly into the constructor as on_transcription=, on_response=, on_status=, etc. — see the Python API Reference.

Transcript

Dynamic prompts

Tool calls

Register the tools themselves with tools=[...] in the constructor (Tool Calling).