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.js 1.3 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
  1. module.exports = /** @type {import('promptfoo').TestSuiteConfig} */ ({
  2. prompts: [
  3. 'Please add the following numbers together: {{a}} and {{b}}',
  4. 'What is the sum of {{a}} and {{b}}?',
  5. ],
  6. providers: [
  7. {
  8. id: 'openai:gpt-4o-mini',
  9. config: {
  10. model: 'gpt-4o-mini',
  11. temperature: 0,
  12. tools: [
  13. {
  14. type: 'function',
  15. function: {
  16. name: 'addNumbers',
  17. description: 'Add two numbers together',
  18. parameters: {
  19. type: 'object',
  20. properties: {
  21. a: { type: 'number' },
  22. b: { type: 'number' },
  23. },
  24. required: ['a', 'b'],
  25. },
  26. },
  27. },
  28. ],
  29. tool_choice: 'auto',
  30. functionToolCallbacks: {
  31. addNumbers: (parametersJsonString) => {
  32. const { a, b } = JSON.parse(parametersJsonString);
  33. return JSON.stringify(a + b);
  34. },
  35. },
  36. },
  37. },
  38. ],
  39. tests: [
  40. {
  41. vars: { a: 5, b: 6 },
  42. assert: [
  43. {
  44. type: 'equals',
  45. value: '11',
  46. },
  47. ],
  48. },
  49. {
  50. vars: { a: 10, b: 20 },
  51. assert: [
  52. {
  53. type: 'javascript',
  54. value: "output.includes('30')",
  55. },
  56. ],
  57. },
  58. ],
  59. });
Tip!

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

Comments

Loading...