Skip to content

A/B testing pass "variant" as argument to test data function #359

@smileLilith

Description

@smileLilith

Allow dynamically creating set of test data based on variant input.

Data can be stored in external file on disk or remotely.

Example

evalite.each([
  { name: "GPT-4o mini", input: { model: "gpt-4o-mini", temp: 0.7 } },
  { name: "GPT-4o", input: { model: "gpt-4o", temp: 0.7 } },
])("Compare models", {
  data: async (variant) => {
    const data = getDynamicallyDataFor(variant);
    return data.map(it => { input: it.foo, expected: it.bar });
  },
  task: async (input, variant) => {
    return generateText({
      model: openai(variant.model),
      temperature: variant.temp,
      prompt: input,
    });
  },
  scorers: [Factuality, Levenshtein],
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions