Skip to content

Commit

Permalink
fix: removed ClosedQA
Browse files Browse the repository at this point in the history
  • Loading branch information
sshivaditya committed Nov 22, 2024
1 parent f11c9ac commit 228d55f
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions evals/llm.eval.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Eval } from "braintrust";
import { Levenshtein, ContextPrecision, ClosedQA } from "autoevals";
import { Levenshtein, ContextPrecision } from "autoevals";
import goldResponses from "./data/eval-gold-responses.json";
import OpenAI from "openai";
import { VoyageAIClient } from "voyageai";
Expand Down Expand Up @@ -156,25 +156,5 @@ void Eval<EvalInput, EvalOutput, string, void, void>("Command Ask LLM", {
openAiApiKey: process.env.OPENROUTER_API_KEY || "",
openAiBaseUrl: inputs.settings.openAiBaseUrl || "",
}),
(args) =>
ClosedQA({
input: args.input.scenario.issue.question,
output: args.output.output,
criteria: (txt: string) => {
// Check if txt overlaps with the array scenario.mustHave
const mustHave = args.input.scenario.responseMustInclude || [];
if (!Array.isArray(mustHave)) {
return true;
}
for (const item of mustHave) {
if (!txt.includes(item)) {
return false;
}
}
return true;
},
openAiApiKey: process.env.OPENROUTER_API_KEY || "",
openAiBaseUrl: inputs.settings.openAiBaseUrl || "",
}),
],
});

0 comments on commit 228d55f

Please sign in to comment.