MCPcopy
hub / github.com/promptfoo/promptfoo / getNunjucksEngineForFilePath

Function getNunjucksEngineForFilePath

src/util/file.ts:47–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45 * This function is separate from the main getNunjucksEngine to avoid circular dependencies
46 */
47export function getNunjucksEngineForFilePath(): nunjucks.Environment {
48 const env = nunjucks.configure({
49 autoescape: false,
50 });
51
52 // Add environment variables as template globals
53 env.addGlobal('env', {
54 ...process.env,
55 ...cliState.config?.env,
56 });
57
58 return env;
59}
60
61/**
62 * Loads content from an external file if the input is a file path, otherwise

Callers 2

loadRubricPromptFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…