google / generative-ai-go

Go SDK for Google Generative AI
Apache License 2.0
547 stars 52 forks source link

Can PDF data be passed as a Blob #27

Closed sdeoras closed 9 months ago

sdeoras commented 9 months ago

This is not a bug. I am just wondering if PDF buffer can be passed?

part := genai.Blob{
        MIMEType: "application/pdf",
        Data:     pdfBytes,
    }

When trying to do so, I get following error:

googleapi: Error 400: Request contains an invalid argument.

Thanks for your help

jba commented 9 months ago

No, the "gemini-pro" model accepts only text, and the "gemini-pro-vision" model accepts only text and images.