File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,12 @@ async def send_text(self):
8686 if text .lower () == "q" :
8787 break
8888 if self .session is not None :
89- await self .session .send (input = text or "." , end_of_turn = True )
89+ await self .session .send_client_content (
90+ turns = types .Content (
91+ role = "user" ,
92+ parts = [types .Part (text = text or "." )]
93+ )
94+ )
9095 else :
9196 print ("Session is not initialized. Unable to send text." )
9297
@@ -162,7 +167,10 @@ async def send_realtime(self):
162167 while True :
163168 msg = await self .out_queue .get ()
164169 if self .session is not None :
165- await self .session .send (input = msg )
170+ # For audio: send as types.Blob
171+ await self .session .send_realtime_input (
172+ media = types .Blob (data = msg ["data" ], mime_type = msg ["mime_type" ])
173+ )
166174 else :
167175 print ("Session is not initialized. Unable to send message." )
168176
You can’t perform that action at this time.
0 commit comments