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
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: Example showing how to override scoring functions
  3. providers:
  4. - openai:gpt-4.1-mini
  5. prompts:
  6. - 'Translate the following text to {{language}}: {{text}}'
  7. defaultTest:
  8. assertScoringFunction: file://./default.js
  9. assert:
  10. - type: llm-rubric
  11. value: Rate the accuracy of the translation of {{text}} from English to {{language}}
  12. metric: accuracy
  13. - type: llm-rubric
  14. value: Rate the fluency of the translation of {{text}} from English to {{language}}
  15. metric: fluency
  16. - type: llm-rubric
  17. value: Rate the grammar of the translation of {{text}} from English to {{language}}
  18. metric: grammar
  19. options:
  20. provider:
  21. text: openai:gpt-4.1-mini
  22. embedding: openai:embedding:text-embedding-3-small
  23. tests:
  24. - description: Default scoring function (geometric mean)
  25. vars:
  26. language: Spanish
  27. text: Hello, how are you today?
  28. assert:
  29. - type: similar
  30. value: Como estas?
  31. metric: similar
  32. - description: Python scoring function (accuracy only)
  33. vars:
  34. language: French
  35. text: The weather is beautiful today.
  36. assertScoringFunction: file://./override.py:calculate_score
  37. - description: JavaScript scoring function (minimum score)
  38. vars:
  39. language: German
  40. text: I love learning new languages.
  41. assert:
  42. - type: contains
  43. value: Bananas
  44. metric: banana
  45. assertScoringFunction: file://./override.js:overrideScoring
Tip!

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

Comments

Loading...