Hello hello
I am trying to get an image from my cloud bucket and send it + a user prompt to gemini vision. I managed to do it for locally stored images but cannot see how to do it when bickets are involved.
Below is the local version:
client, err := genai.NewClient(ctx, option.WithAPIKey(string(API_KEY)))
if err != nil {
log.Fatal(err)
}
defer client.Close()
modelfile, err := client.UploadFileFromPath(ctx, filepath.Join(uploadPath, dtf+".jpg"), nil)
if err != nil {
log.Fatal(err)
}
defer client.DeleteFile(ctx, modelfile.Name)
// ----------------------------- THIS ONE
model := client.GenerativeModel("gemini-1.5-flash")
resp, err := model.GenerateContent(ctx,
genai.FileData{URI: modelfile.URI},
genai.Text(prompt))
Thanks in advance for your help!
Hi @Y-Noor,
Welcome to Google Cloud Community!
Here's an insight of how to fetch an image from a cloud bucket and send it to Gemini Vision in Go.
Additionally, here are some useful documentation that you may check as well:
I hope the above information is helpful.
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |