import { baserun } from "baserun";
import OpenAI from "openai";
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});
describe("Baserun end-to-end", () => {
it("should suggest the Eiffel Tower", async () => {
const chatCompletion = await openai.chat.completions.create({
model: "gpt-3.5-turbo",
temperature: 0.7,
messages: [
{
role: "user",
content: "What are three activities to do in Paris?",
},
],
});
const output = chatCompletion.choices[0].message!.content!;
const notHasLanguageModel = baserun.evals.notIncludes(
"AI Language Model",
output,
["AI language model"]
);
// Optional: will fail the test if "AI language model" is present in the output
expect(notHasLanguageModel).toBeTruthy();
});
});