export default async function server(request: Request): Promise<Response> {
let body: { inputs: Record<string, string>, output: string, correct_answer: string };
body = await request.json();
const score = body.output.toLowerCase() === body.correct_answer.toLowerCase() ? 1.0 : 0.0;
const responseBody = { score };
return new Response(JSON.stringify(responseBody), {
status: 200,
headers: { 'Content-Type': 'application/json' }
});
}