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.code-generation.yaml 1.7 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
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: 'Code generation with Mistral Codestral models'
  3. providers:
  4. - id: mistral:codestral-latest
  5. config:
  6. temperature: 0.2
  7. max_tokens: 2000
  8. prompts:
  9. - '{{request}}'
  10. tests:
  11. - vars:
  12. request: 'Write a Python function that calculates the factorial of a number using recursion. Include docstring and type hints.'
  13. assert:
  14. - type: contains
  15. value: 'def factorial'
  16. - type: contains
  17. value: 'int'
  18. - type: contains
  19. value: 'recursion'
  20. - type: regex
  21. value: '""".*"""'
  22. - vars:
  23. request: 'Create a JavaScript function that validates an email address using regex. Make it robust and handle edge cases.'
  24. assert:
  25. - type: contains
  26. value: 'function'
  27. - type: contains
  28. value: 'email'
  29. - type: contains
  30. value: 'regex'
  31. - type: contains
  32. value: '@'
  33. - vars:
  34. request: 'Write a simple REST API endpoint in Python using FastAPI that accepts POST requests with user data (name, email) and returns a success message.'
  35. assert:
  36. - type: contains
  37. value: '@app.post'
  38. - type: contains
  39. value: 'FastAPI'
  40. - type: contains
  41. value: 'async def'
  42. - type: contains
  43. value: 'name'
  44. - type: contains
  45. value: 'email'
  46. - vars:
  47. request: 'Create a React component that displays a user profile card with name, avatar, and email. Use modern React with hooks.'
  48. assert:
  49. - type: contains
  50. value: 'export'
  51. - type: contains
  52. value: 'useState'
  53. - type: contains
  54. value: 'React'
  55. - type: contains
  56. value: 'avatar'
Tip!

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

Comments

Loading...