Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

promptfooconfig.yaml 1.3 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: External defaultTest configuration example
  3. # Load default test configuration from external file
  4. defaultTest: file://shared/defaultTest.yaml
  5. prompts:
  6. - |
  7. You are a helpful assistant that answers questions concisely.
  8. User: {{question}}
  9. Assistant:
  10. providers:
  11. - openai:o4-mini
  12. - openai:gpt-4.1
  13. tests:
  14. # These test cases will inherit all assertions and options from defaultTest
  15. - vars:
  16. question: What is the capital of France?
  17. # Additional assertions specific to this test
  18. assert:
  19. - type: icontains
  20. value: Paris
  21. - vars:
  22. question: Explain photosynthesis in one sentence.
  23. assert:
  24. - type: contains-any
  25. value:
  26. - sunlight
  27. - plants
  28. - energy
  29. - carbon dioxide
  30. - vars:
  31. question: What is 2 + 2?
  32. assert:
  33. - type: icontains
  34. value: '4'
  35. # This test overrides the provider from defaultTest
  36. - vars:
  37. question: Write a haiku about programming.
  38. options:
  39. provider: openai:gpt-4.1
  40. assert:
  41. - type: javascript
  42. value: |
  43. // Check if output resembles a haiku (3 lines)
  44. const lines = output.trim().split('\n').filter(line => line.trim().length > 0);
  45. return lines.length === 3 ? 1 : 0;
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...