Built-in Evals
Eval Ranking
Provides a ranking score for each context based on specified criteria. This evaluation ensures that contexts are ranked according to their relevance and suitability for the given input.
Was this page helpful?
⌘I
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Provides a ranking score for each context based on specified criteria. This evaluation ensures that contexts are ranked according to their relevance and suitability for the given input.
result = evaluator.evaluate(
eval_templates="eval_ranking",
inputs={
"input": "What is the solar system?",
"context": [
"The solar system consists of the Sun and celestial objects bound to it",
"Our solar system formed 4.6 billion years ago"
]
},
model_name="turing_flash"
)
print(result.eval_results[0].output)
print(result.eval_results[0].reason)
import { Evaluator, Templates } from "@future-agi/ai-evaluation";
const evaluator = new Evaluator();
const result = await evaluator.evaluate(
"eval_ranking",
{
input: "What is the solar system?",
context: [
"The solar system consists of the Sun and celestial objects bound to it",
"Our solar system formed 4.6 billion years ago"
]
},
{
modelName: "turing_flash"
}
);
console.log(result);
| Input | |||
|---|---|---|---|
| Required Input | Type | Description | |
input | string | The input provided to the model | |
context | list[string] | List of contexts to rank |
| Output | ||
|---|---|---|
| Field | Description | |
| Result | Returns a score, where higher values indicate better ranking quality of that context | |
| Reason | Provides a detailed explanation of the ranking assessment |
Was this page helpful?