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.5 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
54
55
56
57
58
59
60
61
62
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: Custom metric naming and derivation for evaluation
  3. prompts:
  4. - 'Say this as though you are a pirate: {{body}}'
  5. - 'Say this as though you are a seafarer from the 17th century: {{body}}'
  6. providers:
  7. - openai:gpt-4.1-mini
  8. derivedMetrics:
  9. - name: DoubleConsistency
  10. value: Consistency * 2
  11. tests:
  12. - description: Check for exact match
  13. vars:
  14. body: Yes
  15. assert:
  16. - type: equals
  17. value: Yarr
  18. metric: Tone
  19. - description: Another basic substring check
  20. vars:
  21. body: I'm hungry
  22. assert:
  23. - type: icontains
  24. value: grub
  25. metric: Tone
  26. - description: Check if output is JSON
  27. vars:
  28. body: Output the story of your life in JSON
  29. assert:
  30. - type: is-json
  31. metric: Consistency
  32. - description: Check for semantic similarity
  33. vars:
  34. body: Hello world
  35. assert:
  36. # Look for substring
  37. - type: javascript
  38. value: output.startsWith('Ahoy')
  39. - type: python
  40. value: max(0, len(output) - 300)
  41. metric: Consistency
  42. # Check for semantic similarity
  43. - type: similar
  44. value: Ahoy, world
  45. metric: Tone
  46. - description: Use LLM to evaluate output
  47. vars:
  48. body: The quick brown fox jumps over the lazy dog
  49. assert:
  50. # Ask the LLM to check if it spoke like a pirate
  51. - type: llm-rubric
  52. value: Is spoken like a pirate
  53. metric: Tone
Tip!

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

Comments

Loading...