File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 18
18
async def generate_content () -> list [str ]:
19
19
# [START googlegenaisdk_live_with_txt]
20
20
from google import genai
21
- from google .genai .types import LiveConnectConfig , HttpOptions , Modality
21
+ from google .genai .types import (
22
+ Content ,
23
+ LiveConnectConfig ,
24
+ HttpOptions ,
25
+ Modality ,
26
+ Part ,
27
+ )
22
28
23
29
client = genai .Client (http_options = HttpOptions (api_version = "v1beta1" ))
24
- model_id = "gemini-2.0-flash-exp "
30
+ model_id = "gemini-2.0-flash-live-preview-04-09 "
25
31
26
32
async with client .aio .live .connect (
27
33
model = model_id ,
28
34
config = LiveConnectConfig (response_modalities = [Modality .TEXT ]),
29
35
) as session :
30
36
text_input = "Hello? Gemini, are you there?"
31
37
print ("> " , text_input , "\n " )
32
- await session .send (input = text_input , end_of_turn = True )
38
+ await session .send_client_content (
39
+ turns = Content (role = "user" , parts = [Part (text = text_input )])
40
+ )
33
41
34
42
response = []
35
43
Original file line number Diff line number Diff line change 1
- google-genai == 1.7 .0
1
+ google-genai == 1.10 .0
You can’t perform that action at this time.
0 commit comments