Skip to content
Open
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
14 changes: 9 additions & 5 deletions src/content/docs/docs/integrations/cloud-firestore.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ const indexConfig = {
collection: "menuInfo",
contentField: "text",
vectorField: "embedding",
embedder: vertexAI.embedder('gemini-embedding-001'),
embedder: vertexAI.embedder('gemini-embedding-001', {
outputDimensionality: 2048
}),
};

const ai = genkit({
Expand Down Expand Up @@ -218,9 +220,9 @@ The prior example requires the `embedding` field to be indexed to work. To creat
The command looks like the following:

```bash
gcloud alpha firestore indexes composite create --project=your-project-id \
--collection-group=yourCollectionName --query-scope=COLLECTION \
--field-config=vector-config='{"dimension":"768","flat": "{}"}',field-path=yourEmbeddingField
gcloud firestore indexes composite create --project=your-project-id \
--collection-group=yourCollectionName --query-scope=COLLECTION \
--field-config=vector-config='{"dimension":"2048","flat": "{}"}',field-path=yourEmbeddingField
```

However, the correct indexing configuration depends on the queries you make and the embedding model you're using.
Expand All @@ -229,12 +231,14 @@ The prior example requires the `embedding` field to be indexed to work. To creat

### Deploy flows as Cloud Functions

To deploy a flow with Cloud Functions, use the Firebase Functions library's built-in support for genkit. The `onCallGenkit` method lets you create a [callable function](https://firebase.google.com/docs/functions/callable?gen=2nd) from a flow. It automatically supports streaming and JSON requests. You can use the [Cloud Functions client SDKs](https://firebase.google.com/docs/functions/callable?gen=2nd#call_the_function) to call them.
To deploy a flow with Cloud Functions, use the Firebase Functions library's built-in support for Genkit. The `onCallGenkit` method lets you create a [callable function](https://firebase.google.com/docs/functions/callable?gen=2nd) from a flow. It automatically supports streaming and JSON requests. You can use the [Cloud Functions client SDKs](https://firebase.google.com/docs/functions/callable?gen=2nd#call_the_function) to call them.

```js
import { onCallGenkit } from 'firebase-functions/https';
import { defineSecret } from 'firebase-functions/params';

const apiKey = defineSecret("apiKey");

export const exampleFlow = ai.defineFlow(
{
name: 'exampleFlow',
Expand Down