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.vision.yaml 2.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
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: Azure OpenAI vision model evaluation
  3. prompts:
  4. # Vision models require a specific message format with content arrays
  5. - file://prompt.vision.json
  6. providers:
  7. # Update with your Azure OpenAI deployment details
  8. - id: azure:chat:gpt-4o
  9. config:
  10. apiHost: your-deployment.openai.azure.com
  11. apiVersion: 2024-02-15-preview
  12. temperature: 0.1
  13. max_tokens: 500
  14. tests:
  15. # Test 1: Load image from URL
  16. - vars:
  17. question: What celestial body is shown in this image?
  18. image_url: https://upload.wikimedia.org/wikipedia/commons/thumb/9/97/The_Earth_seen_from_Apollo_17.jpg/320px-The_Earth_seen_from_Apollo_17.jpg
  19. assert:
  20. - type: contains
  21. value: Earth
  22. # Test 2: Load image from local file (automatically converted to base64)
  23. - vars:
  24. question: What color is the planet in this image?
  25. image_url: file://assets/earth.jpg
  26. assert:
  27. - type: contains-any
  28. value: [blue, green]
  29. # Test 3: Load image as base64 data URI
  30. - vars:
  31. question: Is this an image of a planet?
  32. image_url: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wgARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAX/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIQAxAAAAGgP//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAQUCf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQMBAT8Bf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIBAT8Bf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEABj8Cf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAT8hf//aAAwDAQACAAMAAAAQ/wD/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oACAEDAQE/EH//xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oACAECAQE/EH//xAAUEAEAAAAAAAAAAAAAAAAAAAAA/9oACAEBAAE/EH//2Q==
  33. assert:
  34. - type: equals
  35. value: 'Yes'
  36. # Note: If you see 401 errors, ensure:
  37. # 1. Your AZURE_API_KEY environment variable is set correctly
  38. # 2. The apiHost matches your Azure OpenAI resource name
  39. # 3. Your deployment supports vision (GPT-4V, GPT-4 Turbo with Vision, GPT-4.1)
Tip!

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

Comments

Loading...