Standard Metrics
Evaluate your LLM outputs with standard Farsight metrics
Factuality
Param
Type
Description
Output Type
Output Definition
from farsightai import FarsightAI
# Replace with your openAI credentials
OPEN_AI_KEY = "<openai_key>"
query = "Who is the president of the United States"
farsight = FarsightAI(openai_key=OPEN_AI_KEY)
# Replace this with the actual output of your LLM application
output = "As of my last knowledge update in January 2022, Joe Biden is the President of the United States. However, keep in mind that my information might be outdated as my training data goes up to that time, and I do not have browsing capabilities to check for the most current information. Please verify with up-to-date sources."
knowledge = None # optional param to include additional knowledge
factuality_score = farsight.factuality_score(query, output, knowledge)
print("output: ", factuality_score)
# output: trueConsistency
Param
Type
Description
Output Type
Output Definition
Quality
Param
Type
Description
Output Type
Output Definition
Conciseness
Param
Type
Description
Output Type
Output Definition
Last updated