https://promptfoo.dev/ logo
json prompt file issue
# ❓|questions
m
Hi! I have a relatively large chat prompt with few shot examples. Based on the documentation, it seems like the best practice here is to load the prompt from a json file. I'm running into an issue with the system prompt, which is very large and multi-line. It's valid json and loads fine as a json file, but promptfoo is somehow splitting the prompt into >20 individual prompts and losing all context/instructions. Any recommendations on how to handle an extremely large system prompt from a json file?
nevermind - figured it out!! The prompt contained "-------------------" to separate sections of the instrucitons. promptfoo was interpreting every "---" as a delimiter between prompts 🙂
i
😱 yeah that's an annoying behavior that's still around for backwards compatibility. are you able to work around it? I could potentially add an environment variable to disable this splitting
m
yeah np, it was easy to switch to different characters in the system prompt (actually saved some tokens), so we're good
thanks for the quick reply!