-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception thrown in Google App Engine #26
Comments
I was able to remediate this issue with the following code: // Get access token
var credential = await GoogleCredential.GetApplicationDefaultAsync();
var token = await credential.UnderlyingCredential.GetAccessTokenForRequestAsync();
Environment.SetEnvironmentVariable("GOOGLE_ACCESS_TOKEN", token);
// Create model
var model = _vertexAi.GenerativeModel(Model.GeminiPro);
model.AccessToken = token; Though, it's not ideal. Could you use the |
I agreed that bundled with Google.Apis.Auth is a better solution. Here is the current implementation: generative-ai/src/Mscc.GenerativeAI/GenerativeModel.cs Lines 1543 to 1560 in 96a4602
|
Hello @sebastianbk Thanks for reporting the issue. Please see the additional package That should solve the issue already. I'm going to look into this to see myself how this could be improved Cheers, JoKi PS: Are you using the latest package already? I added some improvements to avoid the exception... Anyways, going to check. |
Hi, this has been improved and (hopefully) resolved in release v1.8.1 |
When deploying an app using this library to Google App Engine, the exception below is thrown.
This happens despite the fact that the application default credentials indeed are available and are being consumed without any issues by Google's own SDKs in .NET.
The text was updated successfully, but these errors were encountered: