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 3.4 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: 'Claude 3.5 vs GPT 4o'
  3. prompts:
  4. - file://prompt.yaml
  5. providers:
  6. - anthropic:messages:claude-3-5-sonnet-20241022
  7. - openai:chat:gpt-4o
  8. defaultTest:
  9. assert:
  10. - type: cost
  11. threshold: 0.01
  12. - type: latency
  13. threshold: 3000
  14. - type: javascript
  15. value: 'output.length <= 100 ? 1 : output.length > 1000 ? 0 : 1 - (output.length - 100) / 900'
  16. tests:
  17. - vars:
  18. riddle: 'I speak without a mouth and hear without ears. I have no body, but I come alive with wind. What am I?'
  19. assert:
  20. # Make sure the LLM output contains this word
  21. - type: icontains
  22. value: echo
  23. # Use model-graded assertions to enforce free-form instructions
  24. - type: llm-rubric
  25. value: Do not apologize
  26. - vars:
  27. riddle: 'You see a boat filled with people. It has not sunk, but when you look again you don’t see a single person on the boat. Why?'
  28. assert:
  29. - type: llm-rubric
  30. value: explains that the people are below deck, or they are all in a relationship
  31. - vars:
  32. riddle: 'The more of this there is, the less you see. What is it?'
  33. assert:
  34. - type: icontains
  35. value: darkness
  36. - vars:
  37. riddle: >-
  38. I have keys but no locks. I have space but no room. You can enter, but
  39. can’t go outside. What am I?
  40. assert:
  41. - type: icontains
  42. value: keyboard
  43. - vars:
  44. riddle: >-
  45. I am not alive, but I grow; I don't have lungs, but I need air; I don't
  46. have a mouth, but water kills me. What am I?
  47. assert:
  48. - type: icontains-any
  49. value:
  50. - fire
  51. - flame
  52. - vars:
  53. riddle: What can travel around the world while staying in a corner?
  54. assert:
  55. - type: icontains
  56. value: stamp
  57. - vars:
  58. riddle: Forward I am heavy, but backward I am not. What am I?
  59. assert:
  60. - type: icontains
  61. value: ton
  62. - vars:
  63. riddle: >-
  64. The person who makes it, sells it. The person who buys it, never uses
  65. it. The person who uses it, doesn't know they're using it. What is it?
  66. assert:
  67. - type: icontains
  68. value: coffin
  69. - vars:
  70. riddle: I can be cracked, made, told, and played. What am I?
  71. assert:
  72. - type: icontains
  73. value: joke
  74. - vars:
  75. riddle: What has keys but can't open locks?
  76. assert:
  77. - type: icontains
  78. value: piano
  79. - vars:
  80. riddle: >-
  81. I'm light as a feather, yet the strongest person can't hold me for much
  82. more than a minute. What am I?
  83. assert:
  84. - type: icontains
  85. value: breath
  86. - vars:
  87. riddle: >-
  88. I can fly without wings, I can cry without eyes. Whenever I go, darkness
  89. follows me. What am I?
  90. assert:
  91. - type: icontains
  92. value: cloud
  93. - vars:
  94. riddle: >-
  95. I am taken from a mine, and shut up in a wooden case, from which I am
  96. never released, and yet I am used by almost every person. What am I?
  97. - vars:
  98. riddle: >-
  99. David's father has three sons: Snap, Crackle, and _____? What is the
  100. name of the third son?
  101. assert:
  102. - type: contains
  103. value: David
  104. - vars:
  105. riddle: >-
  106. I am light as a feather, but even the world's strongest man couldn’t
  107. hold me for much longer than a minute. What am I?
  108. assert:
  109. - type: icontains
  110. value: breath
Tip!

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

Comments

Loading...