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.0 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
  1. description: Test trace UI visualization
  2. providers:
  3. - file://provider-simple-traced.js
  4. prompts:
  5. - 'Explain how {{topic}} works in simple terms'
  6. tests:
  7. - vars:
  8. topic: 'quantum computing'
  9. metadata:
  10. tracingEnabled: true
  11. testCaseId: 'test-case-1'
  12. assert:
  13. # Original javascript assertion
  14. - type: javascript
  15. value: file://trace-assertions.js
  16. # Ensure all expected spans are present
  17. - type: trace-span-count
  18. value:
  19. pattern: 'rag_agent_workflow'
  20. min: 1
  21. max: 1
  22. # Ensure we retrieve exactly 3 documents
  23. - type: trace-span-count
  24. value:
  25. pattern: 'retrieve_document_*'
  26. min: 3
  27. max: 3
  28. # Ensure all reasoning steps occur
  29. - type: trace-span-count
  30. value:
  31. pattern: 'reasoning_*'
  32. min: 3
  33. # Ensure the overall workflow completes quickly
  34. - type: trace-span-duration
  35. value:
  36. pattern: 'rag_agent_workflow'
  37. max: 5000 # 5 seconds max
  38. # Ensure individual operations don't take too long
  39. - type: trace-span-duration
  40. value:
  41. pattern: '*'
  42. max: 1000 # No single span should exceed 1 second
  43. # Ensure no errors occur
  44. - type: trace-error-spans
  45. value:
  46. max_count: 0
  47. - vars:
  48. topic: 'machine learning'
  49. metadata:
  50. tracingEnabled: true
  51. testCaseId: 'test-case-2'
  52. assert:
  53. # Original javascript assertion
  54. - type: javascript
  55. value: file://trace-assertions.js
  56. # Same trace assertions as above
  57. - type: trace-span-count
  58. value:
  59. pattern: 'rag_agent_workflow'
  60. min: 1
  61. max: 1
  62. - type: trace-span-count
  63. value:
  64. pattern: 'retrieve_document_*'
  65. min: 3
  66. max: 3
  67. - type: trace-span-count
  68. value:
  69. pattern: 'reasoning_*'
  70. min: 3
  71. - type: trace-span-duration
  72. value:
  73. pattern: 'rag_agent_workflow'
  74. max: 5000
  75. - type: trace-span-duration
  76. value:
  77. pattern: '*'
  78. max: 1000
  79. - type: trace-error-spans
  80. value:
  81. max_count: 0
  82. # Default assertions that apply to all test cases
  83. defaultTest:
  84. assert:
  85. # Monitor 95th percentile latency (metric only, won't fail tests)
  86. - type: trace-span-duration
  87. value:
  88. pattern: '*'
  89. max: 2000
  90. percentile: 95
  91. weight: 0 # This makes it a metric-only assertion
  92. metric: p95_latency
  93. # Ensure retrieval operations are fast
  94. - type: trace-span-duration
  95. value:
  96. pattern: 'retrieve_document_*'
  97. max: 300 # Each document retrieval should be under 300ms
  98. # Allow up to 5% error rate (more forgiving for production)
  99. - type: trace-error-spans
  100. value:
  101. max_percentage: 5
  102. pattern: '*'
  103. metric: error_rate
  104. # Tracing configuration
  105. tracing:
  106. enabled: true
  107. otlp:
  108. http:
  109. enabled: true
  110. port: 4318
  111. acceptFormats: ['json']
Tip!

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

Comments

Loading...