diff --git a/firestore-genai-chatbot/CHANGELOG.md b/firestore-genai-chatbot/CHANGELOG.md index 09f16368..151bbf4c 100644 --- a/firestore-genai-chatbot/CHANGELOG.md +++ b/firestore-genai-chatbot/CHANGELOG.md @@ -1,3 +1,7 @@ +## Version 0.0.10 + +- Add docs on regional support for Gemini APIs + ## Version 0.0.9 - fix typo in documentation diff --git a/firestore-genai-chatbot/PREINSTALL.md b/firestore-genai-chatbot/PREINSTALL.md index 060fd529..76e3d577 100644 --- a/firestore-genai-chatbot/PREINSTALL.md +++ b/firestore-genai-chatbot/PREINSTALL.md @@ -2,7 +2,11 @@ Use this extension to easily deploy a chatbot using Gemini models, stored and ma On install you will be asked to provide: -- **Gemini API Provider** This extension makes use of the Gemini family of models. Currently the extension supports the Google AI Gemini API and the Vertex AI Gemini API. Learn more about the differences between the Google AI and Vertex AI Gemini APIs here. +- **Gemini API Provider** This extension makes use of the Gemini family of models. Currently the extension supports the Google AI Gemini API and the Vertex AI Gemini API. Learn more about the differences between the Google AI and Vertex AI Gemini APIs [here](https://cloud.google.com/vertex-ai/docs/generative-ai/migrate/migrate-google-ai). + +Note that Generative AI on Vertex AI is only available in the regions listed [here](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/locations-genai). + +A list of languages and regions supported by the Gemini API on Google AI is [here](https://ai.google.dev/available_regions). - **Gemini Model**: Input the name of the Gemini model you would like to use. To view available models for each provider, see: - [Vertex AI Gemini models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models) diff --git a/firestore-genai-chatbot/README.md b/firestore-genai-chatbot/README.md index 634e70c2..c3f4a1a8 100644 --- a/firestore-genai-chatbot/README.md +++ b/firestore-genai-chatbot/README.md @@ -10,7 +10,11 @@ On install you will be asked to provide: -- **Gemini API Provider** This extension makes use of the Gemini family of models. Currently the extension supports the Google AI Gemini API and the Vertex AI Gemini API. Learn more about the differences between the Google AI and Vertex AI Gemini APIs here. +- **Gemini API Provider** This extension makes use of the Gemini family of models. Currently the extension supports the Google AI Gemini API and the Vertex AI Gemini API. Learn more about the differences between the Google AI and Vertex AI Gemini APIs [here](https://cloud.google.com/vertex-ai/docs/generative-ai/migrate/migrate-google-ai). + +Note that Generative AI on Vertex AI is only available in the regions listed [here](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/locations-genai). + +A list of languages and regions supported by the Gemini API on Google AI is [here](https://ai.google.dev/available_regions). - **Gemini Model**: Input the name of the Gemini model you would like to use. To view available models for each provider, see: - [Vertex AI Gemini models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models) @@ -83,7 +87,7 @@ This extension uses other Firebase and Google Cloud Platform services, which hav * Order Field: The field by which to order when fetching conversation history. If absent when processing begins, the current timestamp will be written to this field. Sorting will be in descending order. -* Cloud Functions location: Where do you want to deploy the functions created for this extension? For help selecting a location, refer to the [location selection guide](https://firebase.google.com/docs/functions/locations). +* Cloud Functions location: Where do you want to deploy the functions created for this extension? For help selecting a location, refer to the [location selection guide](https://firebase.google.com/docs/functions/locations). Note that Generative AI on Vertex AI is only available in the regions listed [here](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/locations-genai). A list of languages and regions supported by the Gemini API on Google AI is [here](https://ai.google.dev/available_regions). * Context: Contextual preamble for the generative AI model. A string giving context for the discussion. diff --git a/firestore-genai-chatbot/extension.yaml b/firestore-genai-chatbot/extension.yaml index b5656ccf..99162420 100644 --- a/firestore-genai-chatbot/extension.yaml +++ b/firestore-genai-chatbot/extension.yaml @@ -1,5 +1,5 @@ name: firestore-genai-chatbot -version: 0.0.9 +version: 0.0.10 specVersion: v1beta icon: icon.png @@ -161,7 +161,11 @@ params: description: >- Where do you want to deploy the functions created for this extension? For help selecting a location, refer to the [location selection - guide](https://firebase.google.com/docs/functions/locations). + guide](https://firebase.google.com/docs/functions/locations). Note that + Generative AI on Vertex AI is only available in the regions listed + [here](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/locations-genai). + A list of languages and regions supported by the Gemini API on Google AI + is [here](https://ai.google.dev/available_regions). type: select options: - label: Iowa (us-central1) diff --git a/firestore-multimodal-genai/CHANGELOG.md b/firestore-multimodal-genai/CHANGELOG.md index 501cd720..948c97d6 100644 --- a/firestore-multimodal-genai/CHANGELOG.md +++ b/firestore-multimodal-genai/CHANGELOG.md @@ -1,3 +1,7 @@ +## Version 0.0.9 + +- Add docs on regional support for Gemini APIs + ## Version 0.0.8 - fix typo in documentation diff --git a/firestore-multimodal-genai/PREINSTALL.md b/firestore-multimodal-genai/PREINSTALL.md index 68425387..95ee0c84 100644 --- a/firestore-multimodal-genai/PREINSTALL.md +++ b/firestore-multimodal-genai/PREINSTALL.md @@ -2,7 +2,12 @@ This extension allows you to perform generative tasks using the Gemini API, a cu On installation, you will be asked to provide the following information: -**Gemini API Provider**: This extension makes use of the Gemini family of large language models. Currently the extension supports the Google AI Gemini API (for developers) and the Vertex AI Gemini API. Learn more about the differences between the Google AI and Vertex AI Gemini APIs here. +- **Gemini API Provider** This extension makes use of the Gemini family of models. Currently the extension supports the Google AI Gemini API and the Vertex AI Gemini API. Learn more about the differences between the Google AI and Vertex AI Gemini APIs [here](https://cloud.google.com/vertex-ai/docs/generative-ai/migrate/migrate-google-ai). + +Note that Generative AI on Vertex AI is only available in the regions listed [here](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/locations-genai). + +A list of languages and regions supported by the Gemini API on Google AI is [here](https://ai.google.dev/available_regions). + **Gemini Model**: Input the name of which Gemini model you would like to use. To view available models for each provider, see: - [Vertex AI Gemini models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models) diff --git a/firestore-multimodal-genai/README.md b/firestore-multimodal-genai/README.md index 74dae248..287c33d1 100644 --- a/firestore-multimodal-genai/README.md +++ b/firestore-multimodal-genai/README.md @@ -10,7 +10,12 @@ On installation, you will be asked to provide the following information: -**Gemini API Provider**: This extension makes use of the Gemini family of large language models. Currently the extension supports the Google AI Gemini API (for developers) and the Vertex AI Gemini API. Learn more about the differences between the Google AI and Vertex AI Gemini APIs here. +- **Gemini API Provider** This extension makes use of the Gemini family of models. Currently the extension supports the Google AI Gemini API and the Vertex AI Gemini API. Learn more about the differences between the Google AI and Vertex AI Gemini APIs [here](https://cloud.google.com/vertex-ai/docs/generative-ai/migrate/migrate-google-ai). + +Note that Generative AI on Vertex AI is only available in the regions listed [here](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/locations-genai). + +A list of languages and regions supported by the Gemini API on Google AI is [here](https://ai.google.dev/available_regions). + **Gemini Model**: Input the name of which Gemini model you would like to use. To view available models for each provider, see: - [Vertex AI Gemini models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models) @@ -112,7 +117,7 @@ This extension uses other Firebase and Google Cloud Platform services, which hav * Response Field: The field in the message document into which to put the response. -* Cloud Functions location: Where do you want to deploy the functions created for this extension? For help selecting a location, refer to the [location selection guide](https://firebase.google.com/docs/functions/locations). +* Cloud Functions location: Where do you want to deploy the functions created for this extension? For help selecting a location, refer to the [location selection guide](https://firebase.google.com/docs/functions/locations). Note that Generative AI on Vertex AI is only available in the regions listed [here](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/locations-genai). A list of languages and regions supported by the Gemini API on Google AI is [here](https://ai.google.dev/available_regions). * Temperature: Controls the randomness of the output. Values can range over [0,1], inclusive. A value closer to 1 will produce responses that are more varied, while a value closer to 0 will typically result in less surprising responses from the model. diff --git a/firestore-multimodal-genai/extension.yaml b/firestore-multimodal-genai/extension.yaml index 05206c71..a3c70edb 100644 --- a/firestore-multimodal-genai/extension.yaml +++ b/firestore-multimodal-genai/extension.yaml @@ -1,5 +1,5 @@ name: firestore-multimodal-genai -version: 0.0.8 +version: 0.0.9 specVersion: v1beta icon: icon.png @@ -170,7 +170,11 @@ params: description: >- Where do you want to deploy the functions created for this extension? For help selecting a location, refer to the [location selection - guide](https://firebase.google.com/docs/functions/locations). + guide](https://firebase.google.com/docs/functions/locations). Note that + Generative AI on Vertex AI is only available in the regions listed + [here](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/locations-genai). + A list of languages and regions supported by the Gemini API on Google AI + is [here](https://ai.google.dev/available_regions). type: select options: - label: Iowa (us-central1) diff --git a/firestore-semantic-search/functions/__tests__/types/query.test.ts b/firestore-semantic-search/functions/__tests__/types/query.test.ts index e7bf3ea9..4a41a56f 100644 --- a/firestore-semantic-search/functions/__tests__/types/query.test.ts +++ b/firestore-semantic-search/functions/__tests__/types/query.test.ts @@ -13,7 +13,9 @@ describe('Query class tests', () => { test('toVertexQuery() should return the proper vertex query format', () => { const id = 'testId'; const featureVector = [0.5, 0.6, 0.7]; + const neighborCount = 10; const expectedVertexQuery = { + neighbor_count: neighborCount, datapoint: { datapoint_id: id, feature_vector: featureVector, @@ -21,7 +23,7 @@ describe('Query class tests', () => { }; const query = new Query(id, featureVector); - const result = query.toVertexQuery(); + const result = query.toVertexQuery(neighborCount); expect(result).toEqual(expectedVertexQuery); }); }); diff --git a/firestore-semantic-search/functions/__tests__/vertex/index.test.ts b/firestore-semantic-search/functions/__tests__/vertex/index.test.ts index 43b9f0d4..1bdca87e 100644 --- a/firestore-semantic-search/functions/__tests__/vertex/index.test.ts +++ b/firestore-semantic-search/functions/__tests__/vertex/index.test.ts @@ -290,9 +290,9 @@ describe('queryIndex', () => { expectedUrl, { deployed_index_id: 'ext_test_instance_index', - neighbor_count: 1, queries: [ { + neighbor_count: 1, datapoint: { datapoint_id: 'test-id', feature_vector: [1, 2, 3], diff --git a/firestore-semantic-search/functions/package-lock.json b/firestore-semantic-search/functions/package-lock.json index cfb8aaa3..dd5aaa31 100644 --- a/firestore-semantic-search/functions/package-lock.json +++ b/firestore-semantic-search/functions/package-lock.json @@ -4556,9 +4556,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -12478,9 +12478,9 @@ "dev": true }, "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" }, "for-each": { "version": "0.3.3", diff --git a/firestore-semantic-search/functions/src/common/vertex.ts b/firestore-semantic-search/functions/src/common/vertex.ts index 65eaeff4..90a176a1 100644 --- a/firestore-semantic-search/functions/src/common/vertex.ts +++ b/firestore-semantic-search/functions/src/common/vertex.ts @@ -259,9 +259,8 @@ export async function queryIndex( const response = await axios.post( `https://${endpoint}/v1beta1/projects/${config.projectId}/locations/${config.location}/indexEndpoints/${indexEndpoint}:findNeighbors`, { - queries: queries.map(query => query.toVertexQuery()), + queries: queries.map(query => query.toVertexQuery(searchResults)), deployed_index_id: `ext_${config.instanceId.replace(/-/g, '_')}_index`, - neighbor_count: searchResults, }, { headers: { diff --git a/firestore-semantic-search/functions/src/types/query.ts b/firestore-semantic-search/functions/src/types/query.ts index fa6debd6..843ec7da 100644 --- a/firestore-semantic-search/functions/src/types/query.ts +++ b/firestore-semantic-search/functions/src/types/query.ts @@ -23,8 +23,9 @@ export class Query { this.featureVector = featureVector; } - toVertexQuery() { + toVertexQuery(neighborCount: number) { return { + neighbor_count: neighborCount, datapoint: { datapoint_id: this.id, feature_vector: this.featureVector,