Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am louislva on github.
  • I am louislva (https://keybase.io/louislva) on keybase.
  • I have a public key ASBtlE9_YpxePh6tT9xQMcycAIoCv4zJwSd0IZfhWapsMAo

To claim this, I am signing this object:

@louislva
louislva / jestLLM.ts
Created July 17, 2023 07:53
JestLLM: Extension for Jest's expect() which allows you to grade LLM outputs as semantically correct or not
import { Configuration, OpenAIApi } from "openai";
import { expect as _expect } from "@jest/globals";
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const DEBUG = false;
// const MODEL = "gpt-4-0613";