Last active
April 26, 2023 14:53
-
-
Save tonyOreglia/78b7ce06d99104bdb5d5022bc2eb6b65 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 { OpenAIEmbeddingFunction } from 'chromadb'; | |
| /** | |
| * Lambda API Gateway Event Handler | |
| */ | |
| export const handler = async (event: APIGatewayEvent) => { | |
| // ... ommitted | |
| const journalEntryValues = ['entry1 data', 'entry2 data', 'entry3 data']; | |
| const embedder = new OpenAIEmbeddingFunction(openAiApiKey); | |
| const embeddings = await embedder.generate(entryValues); | |
| // ... ommitted | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment