-
Notifications
You must be signed in to change notification settings - Fork 421
feat(firestore-translate-text): add models and provider #2467
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
Conversation
Will probably require some quick manual testing again with recent changes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for configurable Gemini models and providers to the firestore-translate-text extension. The changes allow users to choose between different Gemini models (2.5 Pro, 2.5 Flash, 2.0 Flash, etc.) and select either Google AI or Vertex AI as the provider, expanding beyond the previous hardcoded Gemini 1.5 Pro with Google AI only.
Key changes include:
- Enhanced configuration system to support model and provider selection
- Updated GenkitTranslator constructor to accept configurable model parameter
- Upgraded Genkit dependencies from version 0.9.7 to 1.14.1
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
firestore-translate-text/functions/src/translate/common.ts | Updated GenkitTranslator to accept configurable model parameter and use dynamic model loading |
firestore-translate-text/functions/src/config.ts | Modified configuration logic to parse provider and model from environment variables |
firestore-translate-text/functions/package.json | Upgraded Genkit-related dependencies to version 1.14.1 |
firestore-translate-text/extension.yaml | Added new parameters for translation provider and Gemini model selection |
firestore-translate-text/README.md | Updated documentation to reflect new provider and model options |
firestore-translate-text/PREINSTALL.md | Updated pre-installation documentation for new configuration options |
firestore-translate-text/CHANGELOG.md | Added changelog entry for version 0.1.24 |
this.model = | ||
plugin === "vertexai" ? gemini15ProVertex : gemini15ProGoogleAI; | ||
plugin === "vertexai" ? vertexAI.model(model) : googleAI.model(model); | ||
|
||
if (!this.model) { | ||
throw new Error(`Invalid Gemini model: ${model}`); |
Copilot
AI
Jul 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The model returned by vertexAI.model() or googleAI.model() is unlikely to be null/undefined. This check may not catch invalid model names as expected. Consider catching and handling the actual error that would be thrown by invalid model names.
Copilot uses AI. Check for mistakes.
Resolves #2466
Resolves #2465