-
Notifications
You must be signed in to change notification settings - Fork 12
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
Application Default Credentials (ADC) has been loaded automatically even I use API Key auth. #9
Comments
Yes, the It's a bit of a small culprit given that Google AI supports both API key and OAuth/ADC whereas Vertex AI works with OAuth/ADC only. In general, I thought that the three constructors should handle it sufficiently. Following your suggestion to introduce a using Mscc.GenerativeAI;
// Google AI with an API key
var googleAI = new GoogleAI(apiKey: "your API key");
var model = googleAI.GenerativeModel(model: Model.GeminiPro);
// Original approach, still valid. Is going to disappear...
// var model = new GenerativeModel(apiKey: "your API key", model: Model.GeminiPro); Sorry, although it has been implemented originally the other way I'm getting more and more accustomed to the newer approach of using the What's your thought? |
Using this approach would open the doors to introduce an interface |
The interface |
Support for newer approach is absolutely fine for me. There is no need to keep "backward-compatibility". It because there are almost no one using this library. It probably only less than 10 people. ha .. 😅 |
…lly even I use API Key auth. #9
…lly even I use API Key auth. #9
Hi, this has been improved and (hopefully) resolved in release v1.8.1 |
When I'm using a API Key authentication on Google AI Gemini API, the library still load my ADC automatically.
This might lead some issues. (Maybe) I'm not sure.
Here is my test code:
LINQPad Query: https://share.linqpad.net/ol86v9he.linq
The text was updated successfully, but these errors were encountered: