So, I'm having issues with my React project
So, basically, I'm creating like an AI chat bot using Gemini's API. I'm trying to add this functionality of uploading multiple images at once from the user for the bot to process. However, it fails to recognize the uploaded image. Only textual convos work. It works for 1 image ig but not for multiple and atp idk what I'm doing wrong.
Would appreciate it if anyone could take a quick look and help me out with it!
#Image Recognition failed in my Web App using Gemini API
29 messages · Page 1 of 1 (latest)
Hey
Can you share you code so that I can have a look?
Or if you can't share your code then I can code right now similar one
please let me know
yea I'd prefer like a VC channel so that I can share exactly what I'm doing to understand the logic
it's kinda complex atm to explain lol
do you think vc works?
or should I share my code here?
ok just gimme a minute
alr
ran into unexpected errors lol
so here are the main 2 files that I'm having issues with:
NewPrompt.jsx:
Upload.jsx:
import React, { useEffect, useRef } from 'react';
import { IKContext, IKImage, IKUpload } from "imagekitio-react";
So the issue is that currently I'm trying to make it such that at any given time, the user can upload a maximum of 3 images at once to be processed by the AI. The system doesn't allow more than 3. And the thing is I'm able to view the uploaded image from the filesystem and it is successfully being stored in a 3rd party storage platform called ImageKit. But the thing is the uploaded image is not visible to the AI and hence cannot parse the uploaded images.
Here's an example:
We can see the image, but the AI can't.
Previously, I had it working for 1 image but then when I wanted to increase the count, it kinda broke everything lol
I'm literally stuck trying to fix this issue. Would appreciate it if you have any ideas?
this was the one that was kinda working earlier with just 1 image upload I believe:
you can probably uses these 2 as base files for guidance