@@ -102,6 +102,7 @@ async def __call__(
102102 self ,
103103 prompt : str ,
104104 model : str ,
105+ temperature : float = 0.9 ,
105106 ) -> GenerationResult : ...
106107
107108
@@ -114,6 +115,7 @@ async def a_generate_image__genai(
114115 / ,
115116 prompt : str ,
116117 model : str ,
118+ temperature : float = 0.9 ,
117119) -> GenerationResult :
118120 """Generate an image using Google Gen AI SDK with nano-banana model."""
119121
@@ -122,7 +124,7 @@ async def a_generate_image__genai(
122124 try :
123125 # Configure generation with image output
124126 config = types .GenerateContentConfig (
125- temperature = 0.9 ,
127+ temperature = temperature ,
126128 max_output_tokens = 8192 ,
127129 response_modalities = ["TEXT" , "IMAGE" ], # Enable image generation
128130 )
@@ -205,6 +207,7 @@ async def __call__(
205207 input_images : List [Image .Image ],
206208 prompt : str ,
207209 model : str ,
210+ temperature : float = 0.9 ,
208211 ) -> GenerationResult : ...
209212
210213
@@ -218,6 +221,7 @@ async def a_edit_image__genai(
218221 input_images : List [Image .Image ],
219222 prompt : str ,
220223 model : str ,
224+ temperature : float = 0.9 ,
221225) -> GenerationResult :
222226 """Edit/generate an image based on input images (can be empty or multiple) using Google Gen AI SDK."""
223227
@@ -247,7 +251,7 @@ async def a_edit_image__genai(
247251
248252 # Configure generation with image output
249253 config = types .GenerateContentConfig (
250- temperature = 0.9 ,
254+ temperature = temperature ,
251255 max_output_tokens = 8192 ,
252256 response_modalities = ["TEXT" , "IMAGE" ], # Enable image generation
253257 )
@@ -321,6 +325,7 @@ async def __call__(
321325 image_path : str ,
322326 prompt : Optional [str ] = None ,
323327 model : str = "gemini-2.5-flash" ,
328+ temperature : float = 0.7 ,
324329 ) -> str : ...
325330
326331
@@ -334,6 +339,7 @@ async def a_describe_image__genai(
334339 image_path : str ,
335340 prompt : Optional [str ] = None ,
336341 model : str = "gemini-2.5-flash" ,
342+ temperature : float = 0.7 ,
337343) -> str :
338344 """Describe an image using Google Gen AI SDK."""
339345 logger .info (f"Describing image: { image_path } " )
@@ -361,7 +367,7 @@ async def a_describe_image__genai(
361367
362368 # Configure generation
363369 config = types .GenerateContentConfig (
364- temperature = 0.7 ,
370+ temperature = temperature ,
365371 max_output_tokens = 2048 ,
366372 )
367373
0 commit comments