python --version
pip install openai pytest
export OPENAI_API_KEY=sk-...
Create a repeatable offline evaluation suite using pytest that runs against a golden dataset and gates CI/CD on minimum score thresholds.
1 import pytest 2 3 @pytest.fixture 4 def golden_dataset(): 5 return [ 6 {"question": "What is the capital of France?", "expected": "Paris"}, 7 {"question": "What year did WWII end?", "expected": "1945"}, 8 {"question": "What language runs on the JVM?", "expected": "Java"}, 9 {"question": "Who wrote Hamlet?", "expected": "Shakespeare"}, 10 {"question": "What does HTTP stand for?", "expected": "HyperText Transfer Protocol"}, 11 ] 12
Sign in to share your feedback and join the discussion.