Skip to content

Conversation

CorieW
Copy link
Member

@CorieW CorieW commented Jul 10, 2025

Resolves #2466

Resolves #2465

  • Tested

@CorieW CorieW marked this pull request as ready for review July 17, 2025 00:29
@CorieW CorieW requested a review from a team as a code owner July 17, 2025 00:29
@cabljac cabljac requested a review from Copilot July 18, 2025 09:24
Copilot

This comment was marked as outdated.

@github-project-automation github-project-automation bot moved this to Changes Requested [PR] in [Cloud] Extensions + Functions Jul 18, 2025
@CorieW CorieW requested a review from cabljac July 18, 2025 10:07
@CorieW
Copy link
Member Author

CorieW commented Jul 18, 2025

Will probably require some quick manual testing again with recent changes

  • Tested

@cabljac cabljac requested a review from Copilot July 22, 2025 08:29
Copy link

@Copilot Copilot AI left a 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

Comment on lines 96 to 100
this.model =
plugin === "vertexai" ? gemini15ProVertex : gemini15ProGoogleAI;
plugin === "vertexai" ? vertexAI.model(model) : googleAI.model(model);

if (!this.model) {
throw new Error(`Invalid Gemini model: ${model}`);
Copy link

Copilot AI Jul 22, 2025

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.

@cabljac cabljac merged commit c4cb697 into next Jul 22, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Changes Requested [PR] to Done in [Cloud] Extensions + Functions Jul 22, 2025
@cabljac cabljac deleted the @invertase/ftt-add-models branch July 22, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate Gemini 1.5 models 🐛 [firestore-translate-text] Add support for Gemini 2.x models

3 participants