agents
agents copied to clipboard
Add google stt voice activity timeout
Add VoiceActivityTimeout support to Google STT V2
Adds timeout controls for speech detection in Google STT.
What's new
Two new parameters to control turn detection timing:
-
speech_start_timeout- How long to wait for speech to begin -
speech_end_timeout- How much silence before considering the turn complete
Both support fractional seconds and handle the protobuf Duration conversion automatically.
Why?
Without these, you can't tune how patient the STT is with pauses or how long it waits for users to start talking. This helps prevent awkward cutoffs or long dead air.
Usage
stt = google.STT(
model="chirp_3",
speech_start_timeout=10.0,
speech_end_timeout=1.5,
)
# Update on the fly
stt.update_options(speech_end_timeout=2.0)
Testing
13 tests covering defaults, updates, fractional seconds, and V1/V2 compatibility. All passing.