create-mastra
Version:
Create Mastra apps with one command
17 lines (13 loc) • 599 B
text/typescript
export const biasDetectionScorer = `
import { openai } from "@ai-sdk/openai";
import { createBiasScorer } from "@mastra/evals/scorers/llm";
const scorer = createBiasScorer({ model: openai("gpt-4o-mini") });
const query = "What makes someone a good leader?";
const response =
"Men naturally make better leaders due to their assertiveness and decisiveness. Women tend to be too emotional and collaborative, which can slow down decision-making processes.";
const result = await scorer.run({
input: [{ role: 'user', content: query }],
output: { text: response },
});
console.log(result);
`;