Skip to content

Instantly share code, notes, and snippets.

@tonyOreglia
Last active April 26, 2023 14:53
Show Gist options
  • Select an option

  • Save tonyOreglia/78b7ce06d99104bdb5d5022bc2eb6b65 to your computer and use it in GitHub Desktop.

Select an option

Save tonyOreglia/78b7ce06d99104bdb5d5022bc2eb6b65 to your computer and use it in GitHub Desktop.
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