@@ -117,15 +117,18 @@ async def send_history(self, history: list[types.Content]):
117117 else :
118118 logger .info ('no content is sent' )
119119
120- async def send_content (self , content : types .Content ):
120+ async def send_content (
121+ self , content : types .Content , turn_complete : bool = True
122+ ):
121123 """Sends a user content to the gemini model.
122124
123- The model will respond immediately upon receiving the content.
125+ By default, the model will respond upon receiving the content.
124126 If you send function responses, all parts in the content should be function
125127 responses.
126128
127129 Args:
128130 content: The content to send to the model.
131+ turn_complete: Whether this content completes the model turn.
129132 """
130133 assert content .parts
131134 if content .parts [0 ].function_response :
@@ -138,7 +141,8 @@ async def send_content(self, content: types.Content):
138141 else :
139142 logger .debug ('Sending LLM new content %s' , content )
140143 if (
141- self ._is_gemini_3_1_flash_live
144+ turn_complete
145+ and self ._is_gemini_3_1_flash_live
142146 and len (content .parts ) == 1
143147 and content .parts [0 ].text
144148 ):
@@ -150,7 +154,7 @@ async def send_content(self, content: types.Content):
150154 await self ._gemini_session .send (
151155 input = types .LiveClientContent (
152156 turns = [content ],
153- turn_complete = True ,
157+ turn_complete = turn_complete ,
154158 )
155159 )
156160
0 commit comments