Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthecheung committed May 3, 2024
1 parent 484de44 commit 6fe566b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/plugins/firebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,28 +90,28 @@ To use it, pass it to the `retrieve()` function:
```js
const docs = await retrieve({
retriever: yourRetrieverRef,
query: "look for something",
config: {limit: 5},
query: 'look for something',
config: { limit: 5 },
});
```

For indexing, use an embedding generator along with the Admin SDK:

```js
import { initializeApp } from "firebase-admin";
import { getFirestore } from "firebase-admin/firestore";
import { initializeApp } from 'firebase-admin';
import { getFirestore } from 'firebase-admin/firestore';
import { textEmbeddingGecko } from '@genkit-ai/vertexai';
import { embed } from '@genkit-ai/ai/embedder';

const app = initializeApp();
const firestore = getFirestore(app);

const indexConfig = {
collection: "yourCollection",
contentField: "yourDataChunks",
vectorField: "embedding",
collection: 'yourCollection',
contentField: 'yourDataChunks',
vectorField: 'embedding',
embedder: textEmbeddingGecko,
}
};

async function indexToFirestore(content) {
const embedding = await embed({
Expand Down

0 comments on commit 6fe566b

Please sign in to comment.