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 768 B

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
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. prompts:
  3. - 'Write a tweet about {{topic}}'
  4. providers:
  5. - openai:gpt-4o-mini
  6. tests:
  7. - vars:
  8. topic: bananas
  9. assert:
  10. - type: python
  11. value: "context['vars']['topic'] in output"
  12. - vars:
  13. topic: potatoes
  14. assert:
  15. - type: python
  16. value: |
  17. # Insert your scoring logic here...
  18. if output == 'Expected output':
  19. return {
  20. 'pass': True,
  21. 'score': 0.5,
  22. 'reason': 'Looks good to me',
  23. }
  24. else:
  25. return {
  26. 'pass': False,
  27. 'score': 0,
  28. 'reason': 'Did not contain expected output',
  29. }
Tip!

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

Comments

Loading...