Repository: promptfoo/promptfoo
Issue: `rubricPrompt` with Nunjucks template not formatted in UI View
Root cause: Documentation Deficiency

**Describe the bug**
When using a custom `rubricPrompt` with Nunjuck for evaluation, the rubric is not formatted in UI. That makes it useless, because what matters are exactly the imputed values, not the template.

**To Reproduce**
Use following config:
```
prompts: >-
  [{
    "role": "system",
    "content": "Translate text into {{ language }}."
  }, {
    "role": "user",
    "content": "{{ input }}"
  }]
providers: vertex:gemini-1.5-flash
defaultTest:
  options:
    rubricPrompt:
      - role: system
        content: >-
          Evaluate the quality of the translation provided by an AI assistant to the user input displayed below.
          Score the response on a scale of 0 to 10.
          Output your response in the following JSON format: {pass: bool, score: number, reason: string}
      - role: user
        content: >-
          [Input Start]
          {{ input }}
          [Input End]

          [Translation Start]
          {{ output }}
          [Translation End]

tests:
  - vars:
      input: "Happy families are all alike. \nAnd every unhappy family is unhappy in its own way."
      language: "Chinese"
    assert:
      - type: llm-rubric
```
and then `eval` it and `promptfoo view`. 

**Expected behavior**
The UI `value` should be shown with the actual values as evaluated (with nunjuck templates replaced) instead of plaintext.

**Screenshots**
![screen](https://github.com/user-attachments/assets/5b928be8-1418-4981-ad20-ecf67ae541ba)

**System information:**

- Promptfoo version: 0.93.0


Hi, I'm trying to take a stab at this issue, I seem to have fixed it, however when I run promptfoo eval it shows me this page: 
<img width="1509" alt="Image" src="https://github.com/user-attachments/assets/7db38cf8-f7d9-4d87-9aef-045840048247" />

Which is different from the screenshot that you've linked. I just wanted to understand if this is because of the API key error that we render a different looking page or if I'm looking at a different page entirely than the one mentioned in this issue? If you think this is good, I can create a PR

Hi @adityabharadwaj198 . I can't tell whether the issue is fixed as the image you shared doesn't show the affected part. To see the prompt template, I believe you have to view the Details of the session.

Thanks @strentom for the reply. These were my steps to reproduce the error:

1. create a `promptfooconfig.yaml` file. Paste contents from the config provided in the issue description to the file.
2. Do npm link to `link your local promptfoo package to the global promptfoo package`
3. run promptfoo eval. Which shows this on the terminal:
<img width="819" alt="Image" src="https://github.com/user-attachments/assets/20a013b4-12b4-414a-9c13-9e07d34ea6f4" />
4. run promptfoo view. Which opens this window on the browser.

<img width="1512" alt="Image" src="https://github.com/user-attachments/assets/9555f1f1-607d-484a-aa41-602622aa68ae" />

Please let me know if there's a step I am missing.

Thanks for clarifying, @adityabharadwaj198 and for hopping on @strentom !

The header row intentionally remains un-rendered because the variables ({{ input }}, {{ language }}, etc.) change with each test cases (try writing an eval with two test cases). I hope this behavior makes sense, but we’re open to alternative suggestions if you have other product ideas! Let me know if anything else comes up.

Ahh I see, so this is expected behavior? 

Yes, exactly! If there are multiple test cases, rendering the header with specific values wouldn’t make sense since each test case has its own set of variables. That’s why we intentionally leave the header as a template.

I am going to close the issue but please feel free to re-open or open a new issue if you have new questions/comments/feedback.