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

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

Comments

Loading...