Hi,I’m facing this error today - it never happened before . I also tried to fix the code as it was instructed here - Troubleshooting guide | Gemini API | Google AI for Developers - but it’s still showing the same failure.
same here. adjusted prompt size, still same error.
Welcome to the forums!
500 errors happen on occasion, and usually if you retry a few seconds or minutes later, it will have been resolved.
Some things you may want to look at or mention:
- What model are you using?
- How many tokens is your prompt, including media?
- What media are you including and how much?
- If you are using media, is this inline or is this using the File API?
Hi,
I’m using gemini-1.5-flash , it probably takes something around 350 tokens per request - I’m using images and all the scripts are fine here infact it was even working really fine yesterday. I work with random images and sometimes it needs 50 images or sometimes 5-10 , but today it’s not even working with a single image . I have also checked it on other websites where the process works as mine and those websites aren’t even working.
It does sound like something might be up.
This is using the AI Studio API, correct?
Exactly which model are you specifying?
Exactly which library are you using?
Exactly how are you including the images?
The more info you can provide about what you’re doing and how increases the chance of figuring out what might be going on.
I just tested with a straight REST request using gemini-1.5-flash-002 and using an “inlineData” part to include the image and didn’t see any issue.
Hi,
I’m not using this for profit or commercial purpose - it’s something like the api is going to separate my images according to face - I mean the api will categorize the image into separate folder according to people.
Is this allowed to do using Gemini api studio?
The question wasn’t about what your purpose is, the question was about what the exact model name is, technical information that will help people replicate your issue, if they can.
Hi,
its model = genai.GenerativeModel(“gemini-1.5-flash”),
i just made my script using this Explore vision capabilities with the Gemini API | Google AI for Developers
which I’m doing ,is this allowed here btw?
Yes, what you’re doing is allowed. I’m editing my original question to be more clear.
Try to adjust it to use a specific model name with id. Such as “gemini-1.5-flash-002”.
The page illustrates two ways of including images.
Can you clarify which library and methods you’re using?
I uploaded locally stored files using pillow
I had a test case using “gemini-1.5-flash-latest” and changed it to use “gemini-1.5-flash” instead, and both work. There must be a typo somewhere. Try posting what your code is doing, taking care to not show your API key.
Can anyone share a code snippet that is erroring out?
Hi, I don’t know why but it’s working fine today . I have used this two times with 12 and 25 images . I’m not seeing the error