@@ -104,6 +104,18 @@ async def send_content(self, content: types.Content):
104104 Args:
105105 content: The content to send to the model.
106106 """
107+ await self ._send_content (content )
108+
109+ async def _send_content (
110+ self , content : types .Content , * , partial : bool = False
111+ ) -> None :
112+ """Sends content, optionally as a partial (non-turn-completing) update.
113+
114+ Args:
115+ content: The content to send to the model.
116+ partial: Whether this content is a partial turn update that does not
117+ complete the model turn.
118+ """
107119 assert content .parts
108120 if content .parts [0 ].function_response :
109121 # All parts have to be function responses.
@@ -115,7 +127,8 @@ async def send_content(self, content: types.Content):
115127 else :
116128 logger .debug ('Sending LLM new content %s' , content )
117129 if (
118- self ._is_gemini_3_x_live
130+ not partial
131+ and self ._is_gemini_3_x_live
119132 and len (content .parts ) == 1
120133 and content .parts [0 ].text
121134 ):
@@ -127,7 +140,7 @@ async def send_content(self, content: types.Content):
127140 await self ._gemini_session .send (
128141 input = types .LiveClientContent (
129142 turns = [content ],
130- turn_complete = True ,
143+ turn_complete = not partial ,
131144 )
132145 )
133146
0 commit comments