@@ -23,16 +23,10 @@ def generate_content() -> str:
2323 client = genai .Client ()
2424
2525 response = client .models .generate_content (
26- model = "gemini-2.5-flash -image" ,
26+ model = "gemini-3-pro -image-preview " ,
2727 contents = ("Generate an image of the Eiffel tower with fireworks in the background." ),
2828 config = GenerateContentConfig (
2929 response_modalities = [Modality .TEXT , Modality .IMAGE ],
30- candidate_count = 1 ,
31- safety_settings = [
32- {"method" : "PROBABILITY" },
33- {"category" : "HARM_CATEGORY_DANGEROUS_CONTENT" },
34- {"threshold" : "BLOCK_MEDIUM_AND_ABOVE" },
35- ],
3630 ),
3731 )
3832 for part in response .candidates [0 ].content .parts :
@@ -41,11 +35,7 @@ def generate_content() -> str:
4135 elif part .inline_data :
4236 image = Image .open (BytesIO ((part .inline_data .data )))
4337 image .save ("output_folder/example-image-eiffel-tower.png" )
44- # Example response:
45- # I will generate an image of the Eiffel Tower at night, with a vibrant display of
46- # colorful fireworks exploding in the dark sky behind it. The tower will be
47- # illuminated, standing tall as the focal point of the scene, with the bursts of
48- # light from the fireworks creating a festive atmosphere.
38+
4939 # [END googlegenaisdk_imggen_mmflash_with_txt]
5040 return True
5141
0 commit comments