-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Google Gemini 2.0 flash has wider range of temperature. #7696
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
Comments
Hello, @anilgulecha! I'm here to assist you with bugs, questions, and becoming a contributor. Let's squash those bugs together! 🤖 To resolve the issue with the In the constructor of the this.temperature = fields?.temperature ?? this.temperature;
if (this.temperature && (this.temperature < 0 || this.temperature > 2)) {
throw new Error("`temperature` must be in the range of [0.0,2.0]");
} This change will allow the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
You may also wish to switch to the @langchain/google-webauth package which has this change already applied. |
Hi How can I pull this locally? currently I see only 0.1.8 available in npm When will newer version be tagged? Regards |
Ah I think this was only fixed for vertex, need to do another release for Gen AI! |
This had been fixed in Vertex/common for a while. I think all you need to do is cut a new release for google-genai. |
Oh my mistake! Will do later today |
Sorry about the delay, just cut! |
Checked other resources
Example Code
const baseLLM = new ChatGoogleGenerativeAI({
model: "gemini-2.0-flash",
temperature: 1,
maxRetries: 1,
maxConcurrency: 1
});
Error Message and Stack Trace (if applicable)
Error:
temperature
must be in the range of [0.0,1.0]at new ChatGoogleGenerativeAI
Description
https://github.com/langchain-ai/langchainjs/blob/main/libs/langchain-google-genai/src/chat_models.ts#L647
The code assumes the temperature has to be b/w 0 and 1. But the latest model supports upto 2 (gemini-2.0-flash)
System Info
I'm on
The text was updated successfully, but these errors were encountered: