Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions firestore-translate-text/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Version 0.1.24

feat - update to allow using Gemini models from Google AI or Vertex AI

feat - choose between latest 2.5 Gemini models from Google AI or Vertex AI

## Version 0.1.23

fixed - backfill feature is disabled for now
Expand Down
6 changes: 3 additions & 3 deletions firestore-translate-text/PREINSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Before installing this extension, make sure that you've [set up a Cloud Firestor

#### AI Translations using Gemini

This extension optionally supports using Gemini 1.5 Pro as an alternative to the Google Cloud Translation API for performing translations.
This extension optionally supports using Gemini as an alternative to the Google Cloud Translation API for performing translations.

The extension accesses the Gemini API via Google AI, and will require an API key to be provided upon installation. You may create an API key [here](https://ai.google.dev/gemini-api/docs/api-key).
The extension can access the Gemini API via either Google AI (using an API key) or Vertex AI (using your Google Cloud project). If you choose Google AI, you will need to provide an API key upon installation, which you can create [here](https://ai.google.dev/gemini-api/docs/api-key). If you choose Vertex AI, the extension will use the Gemini models available in your Google Cloud project and does not require an API key.

A large language model like Gemini 1.5 Pro may have more contextual understanding. For example in the sentence `I left my keys in the bank` the model may understand whether `bank` refers to a financial institution or a riverbank, and may provide a more accurate translation.
Gemini models are large language models (LLMs), which can provide more contextual understanding than traditional translation APIs. For example, in the sentence `I left my keys in the bank`, an LLM may be able to determine whether `bank` refers to a financial institution or a riverbank, and provide a more accurate translation.

It is important to note that Gemini should only be used with sanitized input, as prompt injection is a possibility.

Expand Down
13 changes: 8 additions & 5 deletions firestore-translate-text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ Before installing this extension, make sure that you've [set up a Cloud Firestor

#### AI Translations using Gemini

This extension optionally supports using Gemini 1.5 Pro as an alternative to the Google Cloud Translation API for performing translations.
This extension optionally supports using Gemini as an alternative to the Google Cloud Translation API for performing translations.

The extension accesses the Gemini API via Google AI, and will require an API key to be provided upon installation. You may create an API key [here](https://ai.google.dev/gemini-api/docs/api-key).
The extension can access the Gemini API via either Google AI (using an API key) or Vertex AI (using your Google Cloud project). If you choose Google AI, you will need to provide an API key upon installation, which you can create [here](https://ai.google.dev/gemini-api/docs/api-key). If you choose Vertex AI, the extension will use the Gemini models available in your Google Cloud project and does not require an API key.

A large language model like Gemini 1.5 Pro may have more contextual understanding. For example in the sentence `I left my keys in the bank` the model may understand whether `bank` refers to a financial institution or a riverbank, and may provide a more accurate translation.
Gemini models are large language models (LLMs), which can provide more contextual understanding than traditional translation APIs. For example, in the sentence `I left my keys in the bank`, an LLM may be able to determine whether `bank` refers to a financial institution or a riverbank, and provide a more accurate translation.

It is important to note that Gemini should only be used with sanitized input, as prompt injection is a possibility.

Expand Down Expand Up @@ -83,10 +83,13 @@ To install an extension, your project must be on the [Blaze (pay as you go) plan
* Languages field name: What is the name of the field that contains the languages that you want to translate into? This field is optional. If you don't specify it, the extension will use the languages specified in the LANGUAGES parameter.


* Translation Model: This extension provides the option to use Gemini 1.5 Pro for translations, which may provide more accurate and context-aware translations. The extension accesses the Gemini API using a Google AI API key that you can provide as a secret during installation.
* Translation Provider: Choose the translation provider to use for this extension. "Cloud Translation API" uses the standard Google Cloud Translation service (fast, cost-effective). "Gemini (Google AI)" leverages Google's Gemini models via Google AI Studio for more accurate and context-aware translations (requires Gemini API access and API key). "Gemini (Vertex AI)" uses Gemini models through Vertex AI in your Google Cloud project (requires Vertex AI access).


* Google AI API key: If you selected AI Translations Using Gemini to perform translations, please provide a Google AI API key, which you can create here: https://ai.google.dev/gemini-api/docs/api-key
* Gemini Model: Choose the Gemini model to use for translations. Consider model pricing, performance, and availability in your selected provider. This is only required if you select "AI Translations Using Gemini" as your translation model. By default, the extension uses Gemini 2.5 Flash for a balance of speed and cost.


* Google AI API Key: If you selected "AI Translations Using Gemini" and "Google AI" as the provider, provide your Google AI API key here. You can create an API key at: https://ai.google.dev/gemini-api/docs/api-key. This is not required if you use Vertex AI as the provider.



Expand Down
56 changes: 42 additions & 14 deletions firestore-translate-text/extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

name: firestore-translate-text
version: 0.1.23
version: 0.1.24
specVersion: v1beta

tags: [ai]
Expand Down Expand Up @@ -131,27 +131,55 @@ params:
default: languages
required: false

- param: TRANSLATION_MODEL
label: Translation Model
- param: TRANSLATION_PROVIDER
label: Translation Provider
description: >
This extension provides the option to use Gemini 1.5 Pro for translations,
which may provide more accurate and context-aware translations. The
extension accesses the Gemini API using a Google AI API key that you can
provide as a secret during installation.
Choose the translation provider to use for this extension. "Cloud
Translation API" uses the standard Google Cloud Translation service (fast,
cost-effective). "Gemini (Google AI)" leverages Google's Gemini models via
Google AI Studio for more accurate and context-aware translations
(requires Gemini API access and API key). "Gemini (Vertex AI)" uses Gemini
models through Vertex AI in your Google Cloud project (requires Vertex AI
access).
type: select
required: true
options:
- label: AI Translations Using Gemini
value: gemini
- label: Cloud Translation API
- label: Cloud Translation API (standard, fast, cost-effective)
value: translate
- label: Gemini (Google AI) (more context-aware, requires Gemini API key)
value: gemini-googleai
- label:
Gemini (Vertex AI) (more context-aware, requires Vertex AI access)
value: gemini-vertexai

- param: GEMINI_MODEL
label: Gemini Model
description: >
Choose the Gemini model to use for translations. Consider model pricing,
performance, and availability in your selected provider. This is only
required if you select "AI Translations Using Gemini" as your translation
model. By default, the extension uses Gemini 2.5 Flash for a balance of
speed and cost.
type: select
required: false
options:
- label: Gemini 2.5 Pro (highest quality, expensive)
value: gemini-2.5-pro
- label: Gemini 2.5 Flash (cost-effective, high quality)
value: gemini-2.5-flash
- label: Gemini 2.0 Flash (cost-effective, good quality)
value: gemini-2.0-flash
- label: Gemini 2.0 Flash Lite (cheapest, lowest quality)
value: gemini-2.0-flash-lite
default: gemini-2.5-flash

- param: GOOGLE_AI_API_KEY
label: Google AI API key
label: Google AI API Key
description: >
If you selected AI Translations Using Gemini to perform translations,
please provide a Google AI API key, which you can create here:
https://ai.google.dev/gemini-api/docs/api-key
If you selected "AI Translations Using Gemini" and "Google AI" as the
provider, provide your Google AI API key here. You can create an API key
at: https://ai.google.dev/gemini-api/docs/api-key. This is not required if
you use Vertex AI as the provider.
type: secret
required: false

Expand Down
Loading
Loading