-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Open
Labels
Description
What happened?
https://ai.google.dev/gemini-api/docs/gemini-3?thinking=high#image_generation
Thought signature is required in interactive image editing in gemini 3 pro image preview, but it is not returned in either streaming or non streaming response.
Example Code:
client = AsyncOpenAI(
api_key=API_KEY,
base_url=API_BASE,
max_retries=3
)
model = "vertex_ai_global/gemini-3-pro-image-preview"
messages = [{"role": "user", "content": prompt}]
extra_body = {}
if aspect_ratio or image_size:
image_config = {}
if aspect_ratio:
image_config["aspectRatio"] = aspect_ratio
if image_size:
image_config["imageSize"] = image_size
extra_body["imageConfig"] = image_config
try:
create_params = {
"model": model,
"messages": messages,
}
if extra_body:
create_params["extra_body"] = extra_body
response = await client.chat.completions.create(**create_params)response:
{
"id":"...",
"choices": [
{
"finish_reason":"stop",
"index":0,
"logprobs":null,
"message":{
"content":null,
"refusal":null,
"role":"assistant",
"annotations":null,
"audio":null,
"function_call":null,
"tool_calls":null,
"images":[
{
"image_url":{
"url":"data:image/png;base64,..."
}
}
],
"created":1764228089,
"model":"gemini-3-pro-image-preview",
"object":"chat.completion",
"service_tier":null,
"system_fingerprint":null,
"usage": {}
}
}
]
}
Relevant log output
Are you a ML Ops Team?
No
What LiteLLM version are you on ?
Twitter / LinkedIn details
No response