I can only generate textcontent if i pass the media parts as base64, using a storrage path pointing to my firebase storage files gives a cors error. I’ve allowed cors origin all for the specific bucket.
gcloud storage buckets describe gs://my-firebase-bucket.appspot.com --format="default(cors_config)"
cors_config:
- maxAgeSeconds: 3600
method:
- GET
origin:
- '*'
the file parts im sending:
[
{
"fileData": {
"mimeType": "video/mp4",
"fileUri": "gs://my-firebase-bucket.appspot.com/videos/test.mp4"
}
}
]
The errors i see in the console:
Access to fetch at 'https://firebaseml.googleapis.com/v2beta/projects/my-firebase/locations/us-central1/publishers/google/models/gemini-1.5-flash:generateContent' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
functionBeingCalled.ts:34
POST https://firebaseml.googleapis.com/v2beta/projects/my-firebase/locations/us-central1/publishers/google/models/gemini-1.5-flash:generateContent net::ERR_FAILED 502 (Bad Gateway)
It doesnt matter if i try from a deployed firebase site or localhost. Does anyone have any idea how to solve this?