https://promptfoo.dev/ logo
Unable to load vars from YAML file
# ❓|questions
z
Can anyone please advise on how you load vars from a yaml file? I'm trying this formatting and it's just importing as an empty file
Copy code
yaml
  - description: "Contains PII"
    vars: file://vars/has_pii.yaml
Copy code
yaml
text:
  - "You can contact me at john.doe@example.com for more information."
  - "Call me at (555) 123-4567 anytime."
  - "I live at 123 Main Street, Anytown, CA 12345."
  - "John Smith lives at 123 Oak St and can be reached at john@email.com or (555) 555-1212."
  - "SSN: 123-45-6789"
  - "Card number: 4111-1111-1111-1111"
https://cdn.discordapp.com/attachments/1326948216385572964/1326948216582967326/image.png?ex=67814854&is=677ff6d4&hm=2ff0f4154e9d65604959fdd71a880f18051e42b1d016827de066336022d2084a&
Additionally I can't figure out how to get it to actually use the apiBaseUrl for the localai provider It looks like I should be able to set it in the config but that's not working: https://github.com/promptfoo/promptfoo/blob/main/src/providers/localai.ts#L7
i
just double checking, there is a
vars
directory containing a
has_pii.yaml
file relative to the
promptfooconfig.yaml
right? right now you are providing
text
as a YAML/JSON object, that might be affecting how it's read. do you want to provide it as a string? In that case it would be
Copy code
yaml
text: |-
  - You can contact me at john.doe@example.com for more information.
  - Call me at (555) 123-4567 anytime.
  - I live at 123 Main Street, Anytown, CA 12345.
  - John Smith lives at 123 Oak St and can be reached at john@email.com or (555) 555-1212.
  - SSN: 123-45-6789
  - Card number: 4111-1111-1111-1111