Allow for configurable ranking server url. Delete old ragas call

This commit is contained in:
William Jeynes
2026-04-02 13:48:15 +01:00
parent 7e37a22058
commit 7e586fe17d
4 changed files with 11 additions and 28 deletions
+8 -4
View File
@@ -7,7 +7,7 @@ export async function evaluateWithEnsemble({
answer: string;
method: string
}): Promise<{ validProb: number; invalidProb: number; }> {
const res = await axios.post("http://localhost:8000/evaluate", {
const res = await axios.post(process.env.RANKING_URL ?? "http://localhost:8000/evaluate", {
answer,
method
}, {timeout: 0});
@@ -18,11 +18,15 @@ export async function evaluateWithEnsemble({
return {validProb, invalidProb};
}
// let res = await evaluateWithRoberta({answer: "High-profile political downplaying of COVID-19 (examples: President Trump saying 'it will go away' in MarchAugust 2020)"});
// import dotenv from "dotenv";
// dotenv.config();
// let res = await evaluateWithEnsemble({method:"flan" ,answer: "High-profile political downplaying of COVID-19 (examples: President Trump saying 'it will go away' in MarchAugust 2020)"});
// console.log(res)
// res = await evaluateWithRoberta({answer: "Multiple mirrored reuploads (20202023) put the clip on other channels with titles implying it was a genuine 1970s public information film."});
// res = await evaluateWithEnsemble({method:"roberta" ,answer: "Multiple mirrored reuploads (20202023) put the clip on other channels with titles implying it was a genuine 1970s public information film."});
// console.log(res)
// res = await evaluateWithRoberta({answer: "The COVID-19 Pandemic"});
// res = await evaluateWithEnsemble({method:"logreg" ,answer: "The COVID-19 Pandemic"});
// console.log(res)
-22
View File
@@ -1,22 +0,0 @@
import axios from "axios";
export async function evaluateWithRagas({
question,
answer,
contexts,
}: {
question: string;
answer: string;
contexts: string[];
}) {
const res = await axios.post("http://localhost:8001/evaluate", {
question,
answer,
contexts,
});
return res.data;
}
// let res = await evaluateWithRagas({question: "Who was Bill Nye", answer: "Bill Nye was a Scientist", contexts: ["Bill nye was a Scientist"]});
// console.log(res)