Reputation: 116868
I am trying to send a request to gemini-pro-vision model and it keeps returning this error
400 Multiturn chat is not enabled for models/gemini-pro-vision
My code.
# Create a client
client = generativelanguage_v1beta.GenerativeServiceAsyncClient()
content1 = build_content("user", image, text)
contents2 = build_content("model", image, "This is a dog")
contents3 = build_content("user", image, "Are you Sure?")
request = generativelanguage_v1beta.GenerateContentRequest(
model="models/gemini-pro-vision",
contents=[content1, contents2, contents3],
generation_config=generation_config,
safety_settings=safety_settings
)
# Make the request
response = await client.generate_content(request=request)
# Handle the response
return response.candidates[0].content.parts[0].text
Upvotes: 1
Views: 4770
Reputation: 116868
The issue here is that unlike the gemini-pro model gemini-pro-image has not been optimized for multi-turn conversations. It only supports single requests.
So in my case I had sent it
You cant do this with gemini-pro-vision it doesn't support it.
If you want to do chat you must use Gemini-pro
Please see model-variations
Upvotes: 3
Reputation: 11
Because the gemini-pro-vision model has not been optimized for multi-turn conversations, you cannot use it this way.
Source:Gemini API
Upvotes: 1