@@ -254,3 +254,45 @@ async def test_keeps_affective_dialog_and_proactivity_for_non_gemini_3_1(
254254
255255 assert llm_request .live_connect_config .enable_affective_dialog is True
256256 assert llm_request .live_connect_config .proactivity is not None
257+
258+ @pytest .mark .asyncio
259+ async def test_sets_translation_config (self ):
260+ """Translation config is forwarded to the live connect config."""
261+ agent = LlmAgent (
262+ name = 'test_agent' ,
263+ model = 'gemini-3.5-live-translate-preview' ,
264+ )
265+ invocation_context = await _create_invocation_context (agent )
266+ invocation_context .run_config = RunConfig (
267+ translation_config = types .StreamTranslationConfig (
268+ target_language_code = 'pl' ,
269+ echo_target_language = True ,
270+ ),
271+ )
272+ llm_request = LlmRequest ()
273+ processor = _BasicLlmRequestProcessor ()
274+
275+ async for _ in processor .run_async (invocation_context , llm_request ):
276+ pass
277+
278+ stream_translation_config = (
279+ llm_request .live_connect_config .stream_translation_config
280+ )
281+ assert stream_translation_config .target_language_code == 'pl'
282+ assert stream_translation_config .echo_target_language is True
283+
284+ @pytest .mark .asyncio
285+ async def test_translation_config_defaults_to_none (self ):
286+ """Without a translation config the live connect field stays None."""
287+ agent = LlmAgent (
288+ name = 'test_agent' ,
289+ model = 'gemini-2.5-flash-live' ,
290+ )
291+ invocation_context = await _create_invocation_context (agent )
292+ llm_request = LlmRequest ()
293+ processor = _BasicLlmRequestProcessor ()
294+
295+ async for _ in processor .run_async (invocation_context , llm_request ):
296+ pass
297+
298+ assert llm_request .live_connect_config .stream_translation_config is None
0 commit comments