-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Endpoint issue with Gemini Pro 1.5 and Gemini Flash Support #5437
Comments
specifically around this area |
It seems that if you use |
If you're using any of the packages that use google-common (ie - @langchain/google-gauth, @langchain/google-webauth, @langchain/google-vertexai, or @langchain/google-vertexai-web) you should be able to include const model = new ChatGoogle({
modelName: "gemini-1.5-flash-latest",
apiVersion: "v1beta",
platformType: "gai",
}); |
Anyone have a working configuration using an API key? I tried what @afirstenberg suggested (although not with gai) but that did not work, I get
config:
|
@yharaskrik - which package are you using? What I described works for the packages I specified. |
Ya that's the one I'm using. I think I'm on the latest (since I just installed it today). I'll do some more debugging when I get home. |
Just checked up langchain-google-genai and doesnt seem like theres a api version field there and just uses the constructor default of v1
the fix is probably just adding
|
opened a pr with change but probably needs more testing to see if its all okay
|
@bracesproul - Did we get a regression somewhere? |
Looks like was a regression it seems and a URL is wrong. This is working for me (obviously its a hack, I will see if I can open a PR with the real fix) const baseUrl = 'https://generativelanguage.googleapis.com';
const version = 'v1beta';
const genAi = new ChatGoogleGenerativeAI({
model: 'gemini-1.5-flash-latest',
apiKey: process.env.GEMINI_KEY,
apiVersion: version,
maxRetries: 0,
baseUrl,
});
(genAi as any).client.requestOptions.apiVersion = version;
(genAi as any).client.requestOptions.baseUrl = baseUrl;
(genAi as any).apiVersion = version;
(genAi as any).baseUrl = baseUrl; |
This should be fixed by #5490 ( Please ping if you're still experiencing this issue |
Checked other resources
Example Code
the version should be able to be set from configuration, right now google apis have 2 versions, one called v1, and another called v1beta, the difference is on v1 some of the newest gemini models dont exist on it but on v1beta it does, so being able to set this would allow for more model support of newer generation gemini releases
Error Message and Stack Trace (if applicable)
No response
Description
add the ability to set the google generative api version through config and if not set then default back to v1
System Info
langchain + google community libs
The text was updated successfully, but these errors were encountered: