Sorry for the dumb question, but is there a way I can have a variable be an array? For example, imagine I want a prompt to analyze one or more documents. In my tests, I’d like to have an array called documents and in my nunjucks template I could have a for loop over each document text.
i
ian
01/29/2025, 10:37 PM
yeah that should work. you might need to set an envar though
try setting envar
PROMPTFOO_DISABLE_VAR_EXPANSION=1
and then using an array for a variable 🙂
c
casetextjake
01/30/2025, 12:19 AM
Ah got it. The environment variable will prevent promptfoo from doing the thing where it just runs the same prompt with different scenarios for the same variable but instead treat the variable as an array?