Make initial_prompt and vad_parameters accessible from the client

Expose initial_prompt and vad_parameters as flat client parameters
(consistent with hotwords, send_last_n_segments, etc.), send them as
flat handshake keys, and read them server-side with null-safe
options.get(...). Supersedes #283; avoids the options-bag None.get crash.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Aaron Boxer
2026-06-26 11:05:26 -04:00
committed by Aaron Boxer
parent 9f7a043d8b
commit 2debc0ee80
2 changed files with 15 additions and 0 deletions
+1
View File
@@ -168,6 +168,7 @@ client = TranscriptionClient(
mute_audio_playback=False, # Only used for file input, False by Default
enable_translation=True,
target_language="hi",
initial_prompt=None, # Add context for the model, e.g. 'Jane Doe context'
)
```
It connects to the server running on localhost at port 9090. Using a multilingual model, language for the transcription will be automatically detected. You can also use the language option to specify the target language for the transcription, in this case, English ("en"). The translate option should be set to `True` if we want to translate from the source language to English and `False` if we want to transcribe in the source language.