Skip to content

Configuring streaming behaviour

配置流式传输行为

Supported in ADKPython v0.5.0Experimental

There are some configurations you can set for live(streaming) agents.

您可以为 live(流式传输)智能体设置一些配置。

It's set by RunConfig. You should use RunConfig with your Runner.run_live(...).

它通过 RunConfig 设置。您应该在 Runner.run_live(...) 中使用 RunConfig。

For example, if you want to set voice config, you can leverage speech_config.

例如,如果您想设置语音配置,可以使用 speech_config。

voice_config = genai_types.VoiceConfig(
    prebuilt_voice_config=genai_types.PrebuiltVoiceConfigDict(
        voice_name='Aeolus'
    )
)
speech_config = genai_types.SpeechConfig(voice_config=voice_config)
run_config = RunConfig(speech_config=speech_config)

runner.run_live(
    ...,
    run_config=run_config,
)