MCPcopy Index your code
hub / github.com/promptfoo/promptfoo / createSerializableUnifiedConfig

Function createSerializableUnifiedConfig

src/evaluate.ts:176–201  ·  view source on GitHub ↗
(
  testSuite: EvaluateTestSuite,
  prompts: TestSuite['prompts'],
)

Source from the content-addressed store, hash-verified

174}
175
176function createSerializableUnifiedConfig(
177 testSuite: EvaluateTestSuite,
178 prompts: TestSuite['prompts'],
179): Partial<UnifiedConfig> {
180 const droppedRef = { value: false };
181 const config = {
182 ...testSuite,
183 providers: toSerializableProviderRef(testSuite.providers),
184 defaultTest: toSerializableTestCase(testSuite.defaultTest, droppedRef),
185 tests: Array.isArray(testSuite.tests)
186 ? testSuite.tests.map((t) => toSerializableTestCase(t, droppedRef))
187 : testSuite.tests,
188 scenarios: Array.isArray(testSuite.scenarios)
189 ? testSuite.scenarios.map((s) => toSerializableScenario(s, droppedRef))
190 : testSuite.scenarios,
191 prompts,
192 } as Partial<UnifiedConfig>;
193
194 if (droppedRef.value && testSuite.writeLatestResults) {
195 logger.warn(
196 'Function-valued transform(s) in testSuite were replaced with "[inline function]" markers in the persisted config. Re-running the saved eval will not invoke them; use string expressions or file:// references if you need the config to round-trip.',
197 );
198 }
199
200 return config;
201}
202
203async function resolveGradingProvider(
204 provider: GradingConfig['provider'],

Callers 1

evaluateWithSourceFunction · 0.85

Calls 3

toSerializableTestCaseFunction · 0.85
toSerializableScenarioFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…