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
54
55
56
57
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. prompts:
  3. - file://prompts.txt
  4. providers:
  5. - openai:gpt-4o-mini
  6. tests:
  7. - description: Check for exact match
  8. vars:
  9. body: Yes
  10. assert:
  11. - type: equals
  12. value: Yarr
  13. - description: Another basic substring check
  14. vars:
  15. body: I'm hungry
  16. assert:
  17. - type: icontains
  18. value: grub
  19. - description: Check if output is JSON
  20. vars:
  21. body: Output the story of your life in JSON
  22. assert:
  23. - type: is-json
  24. - description: Check for semantic similarity
  25. vars:
  26. body: Hello world
  27. assert:
  28. # Look for substring
  29. - type: javascript
  30. value: output.startsWith('Ahoy')
  31. - type: python
  32. value: max(0, len(output) - 300)
  33. # Check for semantic similarity
  34. - type: similar
  35. value: Ahoy, world
  36. - description: Use LLM to evaluate output
  37. vars:
  38. body: The quick brown fox jumps over the lazy dog
  39. assert:
  40. # Ask the LLM to check if it spoke like a pirate
  41. - type: llm-rubric
  42. value: Is spoken like a pirate
  43. # $ref can be used as a shorthand to include reusable templates
  44. - $ref: '#/assertionTemplates/containsPirateNoise'
  45. outputPath: output.csv
  46. assertionTemplates:
  47. containsPirateNoise:
  48. type: icontains
  49. value: arrr
Tip!

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

Comments

Loading...