Using google.golang.org/genai v1.49.0 client with a new AQ. prefixed api key the call to upload a file to file search store consistently fails.
client, err := genai.NewClient(ctx, &genai.ClientConfig{
APIKey: os.Getenv("GEMINI_API_KEY"),
Backend: genai.BackendGeminiAPI,
})
store, err := client.FileSearchStores.Create(ctx,
&genai.CreateFileSearchStoreConfig{DisplayName: "My File Search Store"})
op, err := client.FileSearchStores.UploadToFileSearchStoreFromPath(ctx, "~/path/to/file.pdf", store.Name, nil)
With this error: response body is invalid for chunk at offset 0: Error 500, Message: Internal error encountered., Status: INTERNAL, Details: []
I’ve switched to a free tier api key on a different project and the same upload code works as expected.