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.structured-output.yaml 1.4 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
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: Structured outputs with Perplexity (JSON and regex)
  3. prompts:
  4. - 'Tell me about {{movie}}. Format your answer as a structured JSON object.'
  5. - 'What is the postal code for {{city}}, {{country}}?'
  6. providers:
  7. - id: perplexity:sonar
  8. config:
  9. temperature: 0.1
  10. max_tokens: 1000
  11. usage_tier: 'medium' # For cost calculation
  12. response_format:
  13. type: 'json_schema'
  14. json_schema:
  15. schema:
  16. type: 'object'
  17. properties:
  18. title: { type: 'string' }
  19. director: { type: 'string' }
  20. year: { type: 'integer' }
  21. genres: { type: 'array', items: { type: 'string' } }
  22. plot_summary: { type: 'string' }
  23. required: ['title', 'director', 'year', 'genres', 'plot_summary']
  24. # This provider will be used for the first prompt only
  25. - id: perplexity:sonar
  26. config:
  27. temperature: 0.1
  28. max_tokens: 150
  29. usage_tier: 'low' # For cost calculation
  30. response_format:
  31. type: 'regex'
  32. regex:
  33. regex: '[0-9A-Z]{1,10}'
  34. # This provider will be used for the second prompt only
  35. tests:
  36. - vars:
  37. movie: Inception
  38. city: Paris
  39. country: France
  40. - vars:
  41. movie: The Matrix
  42. city: Tokyo
  43. country: Japan
  44. - vars:
  45. movie: Parasite
  46. city: Sydney
  47. country: Australia
Tip!

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

Comments

Loading...