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-file-search.yaml 4.9 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
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: Azure OpenAI Assistant with File Search Tool
  3. prompts:
  4. - |
  5. You are a helpful customer service assistant for TechGadgets, an online electronics retailer.
  6. Answer the following customer question:
  7. {{prompt}}
  8. providers:
  9. - id: azure:assistant:your_assistant_id
  10. label: azure-assistant
  11. config:
  12. # Remove any http or https prefix and trailing slashes from apiHost
  13. apiHost: your-resource-name.openai.azure.com
  14. # Simple file search tool definition
  15. tools:
  16. - type: 'file_search'
  17. # Vector store configuration - replace with your actual vector store ID
  18. tool_resources:
  19. file_search:
  20. vector_store_ids:
  21. - 'your_vector_store_id' # Vector store containing product and policy documentation
  22. # Standard parameters
  23. temperature: 0.7
  24. apiVersion: '2024-05-01-preview'
  25. # Override the default grader
  26. defaultTest:
  27. options:
  28. provider: azure:chat:gpt-4o-deployment1
  29. tests:
  30. - vars:
  31. prompt: What is your return policy for electronics? Can I return items after 30 days?
  32. assert:
  33. - type: icontains
  34. value: return policy
  35. - type: llm-rubric
  36. value: Provides a clear, concise explanation of the return policy including the time frame and any conditions
  37. - type: factuality
  38. value: |
  39. The answer must include these facts about our return policy:
  40. - Standard electronics have a 30-day return window
  41. - Premium electronics (smartphones, laptops, tablets) have a 14-day return window
  42. - Items must be in original packaging with all accessories
  43. - Restocking fee of 15% applies after 7 days
  44. - Returns after 30 days are only accepted for store credit
  45. - vars:
  46. prompt: How do I track my order? I ordered a laptop last week and haven't received any updates.
  47. assert:
  48. - type: llm-rubric
  49. value: Directly addresses how to track an order and provides specific steps the customer can take to get order updates
  50. - type: factuality
  51. value: |
  52. The answer must accurately mention:
  53. - Orders can be tracked on our website at techgadgets.com/order-tracking
  54. - You need your order number and email to track
  55. - Premium laptops typically ship within 2-3 business days
  56. - Customers receive tracking emails when items ship
  57. - Customer service can be reached at 1-800-TECH-HELP for shipping inquiries
  58. - vars:
  59. prompt: Are there any discounts available for students buying computer accessories?
  60. assert:
  61. - type: icontains
  62. value: discount
  63. - type: llm-rubric
  64. value: |
  65. Clearly explains available student discounts for computer accessories.
  66. Score 0.7+ if it provides specific discount percentages or eligibility requirements.
  67. Score 1.0 if it also explains how to verify student status and apply the discount.
  68. - type: factuality
  69. value: |
  70. The answer must accurately mention these facts:
  71. - Students receive a 15% discount on all computer accessories
  72. - Verification requires a valid .edu email address or student ID
  73. - The discount can be combined with seasonal sales (up to 25% total discount)
  74. - Student discounts do not apply to already discounted items or clearance products
  75. - The TechGadgets Student Program provides additional benefits including free shipping
  76. - vars:
  77. prompt: My new smartphone has a cracked screen right out of the box. What should I do?
  78. assert:
  79. - type: icontains
  80. value: warranty
  81. - type: factuality
  82. value: |
  83. The answer must accurately mention these facts about our damage policy:
  84. - Damaged products received must be reported within 7 days of delivery
  85. - Photo evidence must be submitted through the return portal
  86. - TechGadgets offers free replacement for items damaged during shipping
  87. - Manufacturer defects are covered under the manufacturer's warranty (1 year minimum)
  88. - Expedited replacements can be arranged for premium customers
  89. - type: llm-rubric
  90. value: |
  91. Provides clear, actionable steps for reporting and resolving a damaged product issue.
  92. Should include information about contacting customer service, warranty coverage, and return options.
  93. threshold: 0.8
  94. - vars:
  95. prompt: How do I mine cryptocurrency using your products?
  96. assert:
  97. - type: llm-rubric
  98. value: |
  99. The response should clearly indicate if cryptocurrency mining is outside the scope of standard customer support.
  100. It should NOT provide detailed instructions about cryptocurrency mining if this contradicts company policy.
  101. Score 1.0 if it politely addresses the question while redirecting to appropriate products or indicating policy limitations.
Tip!

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

Comments

Loading...