Tonic validate
AnswerConsistencyBinaryEvaluator #
Bases: BaseEvaluator
Tonic Validate's answer consistency binary metric.
The output score is a float that is either 0.0 or 1.0.
See https://docs.tonic.ai/validate/ for more details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
openai_service(OpenAIService)
|
The OpenAI service to use. Specifies the chat completion model to use as the LLM evaluator. Defaults to "gpt-4". |
required |
Source code in llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/llama_index/evaluation/tonic_validate/answer_consistency_binary.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
AnswerConsistencyEvaluator #
Bases: BaseEvaluator
Tonic Validate's answer consistency metric.
The output score is a float between 0.0 and 1.0.
See https://docs.tonic.ai/validate/ for more details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
openai_service(OpenAIService)
|
The OpenAI service to use. Specifies the chat completion model to use as the LLM evaluator. Defaults to "gpt-4". |
required |
Source code in llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/llama_index/evaluation/tonic_validate/answer_consistency.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
AnswerSimilarityEvaluator #
Bases: BaseEvaluator
Tonic Validate's answer similarity metric.
The output score is a float between 0.0 and 5.0.
See https://docs.tonic.ai/validate/ for more details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
openai_service(OpenAIService)
|
The OpenAI service to use. Specifies the chat completion model to use as the LLM evaluator. Defaults to "gpt-4". |
required |
Source code in llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/llama_index/evaluation/tonic_validate/answer_similarity.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
AugmentationAccuracyEvaluator #
Bases: BaseEvaluator
Tonic Validate's augmentation accuracy metric.
The output score is a float between 0.0 and 1.0.
See https://docs.tonic.ai/validate/ for more details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
openai_service(OpenAIService)
|
The OpenAI service to use. Specifies the chat completion model to use as the LLM evaluator. Defaults to "gpt-4". |
required |
Source code in llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/llama_index/evaluation/tonic_validate/augmentation_accuracy.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
AugmentationPrecisionEvaluator #
Bases: BaseEvaluator
Tonic Validate's augmentation precision metric.
The output score is a float between 0.0 and 1.0.
See https://docs.tonic.ai/validate/ for more details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
openai_service(OpenAIService)
|
The OpenAI service to use. Specifies the chat completion model to use as the LLM evaluator. Defaults to "gpt-4". |
required |
Source code in llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/llama_index/evaluation/tonic_validate/augmentation_precision.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
RetrievalPrecisionEvaluator #
Bases: BaseEvaluator
Tonic Validate's retrieval precision metric.
The output score is a float between 0.0 and 1.0.
See https://docs.tonic.ai/validate/ for more details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
openai_service(OpenAIService)
|
The OpenAI service to use. Specifies the chat completion model to use as the LLM evaluator. Defaults to "gpt-4". |
required |
Source code in llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/llama_index/evaluation/tonic_validate/retrieval_precision.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
TonicValidateEvaluator #
Bases: BaseEvaluator
Tonic Validate's validate scorer. Calculates all of Tonic Validate's metrics.
See https://docs.tonic.ai/validate/ for more details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metrics(List[Metric])
|
The metrics to use. Defaults to all of Tonic Validate's metrics. |
required | |
model_evaluator(str)
|
The OpenAI service to use. Specifies the chat completion model to use as the LLM evaluator. Defaults to "gpt-4". |
required |
Source code in llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/llama_index/evaluation/tonic_validate/tonic_validate_evaluator.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
aevaluate_run
async
#
aevaluate_run(queries: List[str], responses: List[str], contexts_list: List[List[str]], reference_responses: List[str], **kwargs: Any) -> Any
Evaluates a batch of responses.
Returns a Tonic Validate Run object, which can be logged to the Tonic Validate UI. See https://docs.tonic.ai/validate/ for more details.
Source code in llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/llama_index/evaluation/tonic_validate/tonic_validate_evaluator.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
evaluate_run #
evaluate_run(queries: List[str], responses: List[str], contexts_list: List[List[str]], reference_responses: List[str], **kwargs: Any) -> Any
Evaluates a batch of responses.
Returns a Tonic Validate Run object, which can be logged to the Tonic Validate UI. See https://docs.tonic.ai/validate/ for more details.
Source code in llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/llama_index/evaluation/tonic_validate/tonic_validate_evaluator.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|