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.1 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: 'Is-SQL example'
  3. prompts:
  4. - |
  5. Output a SQL query that returns the number of {{product}} sold in the last month.
  6. Database schema:
  7. {{database}}
  8. Only output raw SQL code without markdown.
  9. providers:
  10. - openai:gpt-4o-mini
  11. - openai:gpt-4o
  12. tests:
  13. - vars:
  14. product: bananas
  15. database: file://database.sql
  16. assert:
  17. # Ensure output is a valid SQL query
  18. - type: is-sql
  19. - type: icontains
  20. value: 'Select'
  21. - vars:
  22. product: apples
  23. database: file://database.sql
  24. assert:
  25. # Ensure output is a valid SQL query
  26. - type: is-sql
  27. value:
  28. databaseType: 'MySQL'
  29. # Ensure only the following tables are used
  30. allowedTables:
  31. - select::null::Products
  32. - select::null::Shipments
  33. - vars:
  34. product: oranges
  35. database: file://database.sql
  36. assert:
  37. - type: is-sql
  38. value:
  39. databaseType: 'MySQL'
  40. allowedColumns:
  41. # We expect this test to fail no matter what
  42. - select::null::DoesntExist
Tip!

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

Comments

Loading...