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 2.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
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: 'Structured prompts'
  3. prompts:
  4. # Schema output with `steps` array
  5. - label: 'With step-by-step'
  6. raw: 'You are a helpful math tutor. Solve {{problem}}'
  7. config:
  8. response_format:
  9. type: json_schema
  10. json_schema:
  11. name: math_response
  12. strict: true
  13. schema:
  14. type: object
  15. properties:
  16. steps:
  17. type: array
  18. items:
  19. type: object
  20. properties:
  21. explanation:
  22. type: string
  23. output:
  24. type: string
  25. required:
  26. - explanation
  27. - output
  28. additionalProperties: false
  29. final_answer:
  30. type: string
  31. required:
  32. - steps
  33. - final_answer
  34. additionalProperties: false
  35. # Schema output without `steps` array
  36. - label: 'Without step-by-step'
  37. raw: 'You are a helpful math tutor. Solve {{problem}}'
  38. config:
  39. response_format:
  40. type: json_schema
  41. json_schema:
  42. name: math_response
  43. strict: true
  44. schema:
  45. type: object
  46. properties:
  47. final_answer:
  48. type: string
  49. required:
  50. - final_answer
  51. additionalProperties: false
  52. providers:
  53. - openai:chat:gpt-4o-2024-11-20
  54. - id: azure:chat:gpt-4o-2024-08-06
  55. config:
  56. apiHost: 'YOUR_ORG.openai.azure.com'
  57. apiVersion: '2024-08-01-preview'
  58. deploymentName: 'YOUR_DEPLOYMENT_NAME'
  59. defaultTest:
  60. assert:
  61. - type: is-json
  62. - type: javascript
  63. value: typeof output === 'object'
  64. tests:
  65. - vars:
  66. problem: '8x + 31 = 2'
  67. assert:
  68. - type: contains-any
  69. value:
  70. - -3.625
  71. - -29/8
  72. - vars:
  73. problem: 'sqrt(x) = 4.9'
  74. assert:
  75. - type: contains
  76. value: 24.01
Tip!

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

Comments

Loading...