You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(firestore-translate-text): optionally allow genkit for translations (#2228)
* feat(firestore-translate-text): optionally allow the use of Gemini 1.5 Pro for translations
* chore(firestore-translate-text): bump extension version
* chore(firestore-translate-text): add JSDoc comments to new code
Copy file name to clipboardExpand all lines: firestore-translate-text/PREINSTALL.md
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,24 @@ of languages, such as `en,fr,de`. See the [supported languages list](https://clo
33
33
34
34
Before installing this extension, make sure that you've [set up a Cloud Firestore database](https://firebase.google.com/docs/firestore/quickstart) in your Firebase project.
35
35
36
+
#### Optional Genkit Integration
37
+
38
+
This extension optionally supports Genkit as an alternative to the Google Cloud Translation API for performing translations. With Genkit, you can leverage large language models such as Google AI Gemini or Vertex AI Gemini to generate translations.
39
+
40
+
##### How it works:
41
+
Genkit Integration allows you to use the powerful Gemini 1.5 Pro model for translations. When enabled, the extension uses the specified Genkit provider to perform the translations instead of the default Cloud Translation API.
42
+
43
+
You can choose between:
44
+
45
+
- Google AI: Uses the googleai plugin with an API key.
46
+
- Vertex AI: Uses the vertexai plugin and connects to your Google Cloud Vertex AI endpoint.
47
+
48
+
In theory, 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.
49
+
50
+
##### Notes:
51
+
- Using Genkit may incur additional charges based on your model provider (Google AI or Vertex AI).
52
+
- If you do not wish to use Genkit, the extension defaults to the Cloud Translation API.
53
+
36
54
#### Billing
37
55
To install an extension, your project must be on the [Blaze (pay as you go) plan](https://firebase.google.com/pricing)
Copy file name to clipboardExpand all lines: firestore-translate-text/README.md
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,24 @@ of languages, such as `en,fr,de`. See the [supported languages list](https://clo
41
41
42
42
Before installing this extension, make sure that you've [set up a Cloud Firestore database](https://firebase.google.com/docs/firestore/quickstart) in your Firebase project.
43
43
44
+
#### Optional Genkit Integration
45
+
46
+
This extension optionally supports Genkit as an alternative to the Google Cloud Translation API for performing translations. With Genkit, you can leverage large language models such as Google AI Gemini or Vertex AI Gemini to generate translations.
47
+
48
+
##### How it works:
49
+
Genkit Integration allows you to use the powerful Gemini 1.5 Pro model for translations. When enabled, the extension uses the specified Genkit provider to perform the translations instead of the default Cloud Translation API.
50
+
51
+
You can choose between:
52
+
53
+
- Google AI: Uses the googleai plugin with an API key.
54
+
- Vertex AI: Uses the vertexai plugin and connects to your Google Cloud Vertex AI endpoint.
55
+
56
+
In theory, 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.
57
+
58
+
##### Notes:
59
+
- Using Genkit may incur additional charges based on your model provider (Google AI or Vertex AI).
60
+
- If you do not wish to use Genkit, the extension defaults to the Cloud Translation API.
61
+
44
62
#### Billing
45
63
To install an extension, your project must be on the [Blaze (pay as you go) plan](https://firebase.google.com/pricing)
46
64
@@ -70,6 +88,15 @@ To install an extension, your project must be on the [Blaze (pay as you go) plan
70
88
* 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.
71
89
72
90
91
+
* Use Genkit for translations?: If you want to use Genkit to perform translations, select "Yes" and provide the necessary configuration parameters. If you select "No", the extension will use Google Cloud Translation API.
92
+
93
+
94
+
* Genkit Gemini provider: If you selected to use Genkit to perform translations, please provide the name of the Gemini API you want to use.
95
+
96
+
97
+
* Google AI API key: If you selected to use Genkit with Google AI to perform translations, please provide a Google AI API key
98
+
99
+
73
100
74
101
75
102
**Cloud Functions:**
@@ -84,6 +111,8 @@ To install an extension, your project must be on the [Blaze (pay as you go) plan
84
111
85
112
* translate.googleapis.com (Reason: To use Google Translate to translate strings into your specified target languages.)
86
113
114
+
* aiplatform.googleapis.com (Reason: This extension uses the Vertex AI multimodal model for embedding images, if configured to do so.)
115
+
87
116
88
117
89
118
**Access Required**:
@@ -93,3 +122,5 @@ To install an extension, your project must be on the [Blaze (pay as you go) plan
93
122
This extension will operate with the following project IAM roles:
94
123
95
124
* datastore.user (Reason: Allows the extension to write translated strings to Cloud Firestore.)
125
+
126
+
* aiplatform.user (Reason: This extension requires access to Vertex AI to create, update and query a Vertex Matching Engine index.)
0 commit comments