@@ -81,11 +81,11 @@ async def test_send_history(gemini_connection, mock_gemini_session):
8181
8282 await gemini_connection .send_history (history )
8383
84- mock_gemini_session .send .assert_called_once ()
85- call_args = mock_gemini_session .send .call_args [1 ]
86- assert 'input ' in call_args
87- assert call_args ['input' ]. turns == history
88- assert call_args ['input' ]. turn_complete is False # Last message is from model
84+ mock_gemini_session .send_client_content .assert_called_once ()
85+ call_args = mock_gemini_session .send_client_content .call_args [1 ]
86+ assert 'turns ' in call_args
87+ assert call_args ['turns' ] == history
88+ assert call_args ['turn_complete' ] is False # Last message is from model
8989
9090
9191@pytest .mark .asyncio
@@ -668,9 +668,9 @@ async def test_send_history_filters_audio(mock_gemini_session, audio_part):
668668
669669 await connection .send_history (history )
670670
671- mock_gemini_session .send .assert_called_once ()
672- call_args = mock_gemini_session .send .call_args [1 ]
673- sent_contents = call_args ['input' ]. turns
671+ mock_gemini_session .send_client_content .assert_called_once ()
672+ call_args = mock_gemini_session .send_client_content .call_args [1 ]
673+ sent_contents = call_args ['turns' ]
674674 # Only the model response should be sent (user audio filtered out)
675675 assert len (sent_contents ) == 1
676676 assert sent_contents [0 ].role == 'model'
@@ -696,9 +696,9 @@ async def test_send_history_keeps_image_data(mock_gemini_session):
696696
697697 await connection .send_history (history )
698698
699- mock_gemini_session .send .assert_called_once ()
700- call_args = mock_gemini_session .send .call_args [1 ]
701- sent_contents = call_args ['input' ]. turns
699+ mock_gemini_session .send_client_content .assert_called_once ()
700+ call_args = mock_gemini_session .send_client_content .call_args [1 ]
701+ sent_contents = call_args ['turns' ]
702702 # Both contents should be sent (image is not filtered)
703703 assert len (sent_contents ) == 2
704704 assert sent_contents [0 ].parts [0 ].inline_data == image_blob
@@ -728,9 +728,9 @@ async def test_send_history_mixed_content_filters_only_audio(
728728
729729 await connection .send_history (history )
730730
731- mock_gemini_session .send .assert_called_once ()
732- call_args = mock_gemini_session .send .call_args [1 ]
733- sent_contents = call_args ['input' ]. turns
731+ mock_gemini_session .send_client_content .assert_called_once ()
732+ call_args = mock_gemini_session .send_client_content .call_args [1 ]
733+ sent_contents = call_args ['turns' ]
734734 # Content should be sent but only with the text part
735735 assert len (sent_contents ) == 1
736736 assert len (sent_contents [0 ].parts ) == 1
0 commit comments