🎯 fix: Google AI Client Stability; feat: gemini-exp
models
#4781
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Removed the 7-second timeout constraint that was likely causing AbortError in the Google client
Increased delay timings from 12 to 15 seconds for generative models to prevent premature timeouts
Created a regex constant
EXCLUDED_GENAI_MODELS
to better identify and handle Gemini modelsUpdated model detection logic to use regex testing instead of string, to use
@google/generative-ai
explicitly for latest modelsRemoved beta API version specification for generative models to use the stable release
Simplified the GenAI client initialization by removing unnecessary configuration
Updated
@langchain/google-genai
package from 0.1.3 to 0.1.4 for latest model supportImproved debug logging to accurately reflect the model type being used
Bug fix (non-breaking change which fixes an issue)
My code adheres to this project's style guidelines
I have performed a self-review of my own code
My changes do not introduce new warnings
Local unit tests pass with my changes