Configuring streaming behavior¶
Supported in ADKPython v0.5.0Java v0.2.0Experimental
There are some configurations you can set for live(streaming) agents.
It's set by RunConfig. You should use RunConfig with your Runner.run_live(...).
For example, if you want to set voice config, you can leverage speech_config.
import com.google.adk.agents.RunConfig;
import com.google.genai.types.PrebuiltVoiceConfig;
import com.google.genai.types.SpeechConfig;
import com.google.genai.types.VoiceConfig;
VoiceConfig voiceConfig =
VoiceConfig.builder()
.prebuiltVoiceConfig(PrebuiltVoiceConfig.builder().voiceName("Aoede").build())
.build();
SpeechConfig speechConfig = SpeechConfig.builder().voiceConfig(voiceConfig).build();
RunConfig runConfig = RunConfig.builder().setSpeechConfig(speechConfig).build();
runner.runLive(
// ...,
runConfig);
RunConfig accepts many more settings than speech_config. For the full list, see Part 4: Understanding RunConfig.
Python: audio transcription is on by default
The input_audio_transcription and output_audio_transcription fields of RunConfig default to AudioTranscriptionConfig(), not None, so ADK asks the Live API to transcribe both the user's audio and the model's audio unless you explicitly set them to None. See Part 5: Audio Transcription.