Created
April 26, 2023 14:54
-
-
Save tonyOreglia/86fcff89aa2f1975f351d763bf28ad22 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ChromaClient } from 'chromadb'; | |
| export const handler = async (event: APIGatewayEvent) => { | |
| // ... ommitted | |
| const chromaDbClient = new ChromaClient(CHROMADB_BASE_PATH); | |
| let userCollection = await chromaDbClient.getOrCreateCollection(userUuid); | |
| const entryIds = [1, 2, 3] | |
| // embeddings are generated in previous snippet | |
| await userCollection.add(entryIds, embeddings); | |
| // ... ommitted | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment