Open majuansari opened 1 month ago
Reproduced. Looking into it.
Set the mime type explicitly.
opts := &genai.UploadFileOptions{MIMEType: "text/plain"}
client.UploadFile(ctx, "", osf, opts)
We'll update our example to match.
Regarding the other issue, that is a constraint on cached content: it has to be fairly large (or it's not worth caching it).
We'll update our example to match.
Regarding the other issue, that is a constraint on cached content: it has to be fairly large (or it's not worth caching it).
Thanks working now.
Regarding the token count issue, i doubt it's due to the size. i gave a big pdf file as input.
I'll look into that as well.
Reopening for token count.
@jba Thanks.
One more question. Can I use this package with vertex ai ?
No, you have to use https://pkg.go.dev/cloud.google.com/go/vertexai/genai.
Description of the bug:
Getting the error - rpc error: code = InvalidArgument desc = Unsupported MIME type: text/plain; charset=utf-8 for the following for CreateCachedContent
Actual vs expected behavior:
Error shouldn't be coming as this is part of the example
Any other information you'd like to share?
for same code if use pdf or images - getting the following error
rpc error: code = InvalidArgument desc = Cached content is too small. total_token_count=9, min_total_token_count=32768