MCPcopy
hub / github.com/promptfoo/promptfoo / createRunEvalState

Function createRunEvalState

src/evaluator.ts:653–679  ·  view source on GitHub ↗
({
  provider,
  prompt,
  test,
}: Pick<RunEvalOptions, 'provider' | 'prompt' | 'test'>)

Source from the content-addressed store, hash-verified

651}
652
653function createRunEvalState({
654 provider,
655 prompt,
656 test,
657}: Pick<RunEvalOptions, 'provider' | 'prompt' | 'test'>): RunEvalState {
658 const vars = structuredClone(test.vars || {});
659 const fileMetadata = collectFileMetadata(vars);
660 const conversationKey = `${provider.label || provider.id()}:${prompt.id}${test.metadata?.conversationId ? `:${test.metadata.conversationId}` : ''}`;
661
662 const setup = createRunEvalSetup({
663 provider,
664 prompt,
665 promptConfig: {
666 ...(prompt.config ?? {}),
667 ...(test.options ?? {}),
668 },
669 vars,
670 });
671
672 return {
673 conversationKey,
674 fileMetadata,
675 promptForRender: { ...prompt },
676 setup,
677 vars,
678 };
679}
680
681/**
682 * Reserved keys for eval-step runtime vars. `EvalRuntimeVars` below is keyed by

Callers 1

runEvalInternalFunction · 0.85

Calls 3

collectFileMetadataFunction · 0.90
createRunEvalSetupFunction · 0.85
idMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…