Skip to content

Instantly share code, notes, and snippets.

@evaletolab
Last active April 2, 2023 13:22
Show Gist options
  • Save evaletolab/b7496b26954d4e94eaa599f5f87836c0 to your computer and use it in GitHub Desktop.
Save evaletolab/b7496b26954d4e94eaa599f5f87836c0 to your computer and use it in GitHub Desktop.
require('dotenv').config();
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const response = await openai.createEmbedding({
model: "text-embedding-ada-002",
input: "The food was delicious and the waiter...",
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment