Installing FutureAGI SDK
Copy
Ask AI
pip install futureagi
Initializing FutureAGI Evals
Copy
Ask AI
from fi.evals import Evaluator
evaluator = 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.
Define the Evaluation and run it
Copy
Ask AI
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)