from fi.evals import Evaluatorevaluator = Evaluator(fi_api_key="<your_api_key>", fi_secret_key="<your_api_secret>") # Optional, if you want to set the API key and secret key manually
Click here to learn how to access your API keys.
It’s recommended to set the API key and secret key as environment variables.
result = evaluator.evaluate( eval_templates="context_adherence", inputs={ "context": "Honey never spoils because it has low moisture content and high acidity, creating an environment that resists bacteria and microorganisms. Archaeologists have even found pots of honey in ancient Egyptian tombs that are still perfectly edible.", "output": "Honey doesn't spoil because its low moisture and high acidity prevent the growth of bacteria and other microbes." }, model_name="turing_flash")print(result.eval_results[0].output)print(result.eval_results[0].reason)