better params fields

This commit is contained in:
Xi Yan 2025-03-12 21:31:22 -07:00
parent 93c131ed5f
commit a7abe6df74
3 changed files with 763 additions and 571 deletions

View file

@ -6388,90 +6388,114 @@
"AnswerCorrectnessScoringFnParams": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "answer_correctness",
"default": "answer_correctness"
},
"answer_correctness": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"title": "BasicScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"type"
"type",
"answer_correctness"
],
"title": "AnswerCorrectnessScoringFnParams"
},
"AnswerRelevancyScoringFnParams": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "answer_relevancy",
"default": "answer_relevancy"
},
"answer_relevancy": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"title": "BasicScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"type"
"type",
"answer_relevancy"
],
"title": "AnswerRelevancyScoringFnParams"
},
"AnswerSimilarityScoringFnParams": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "answer_similarity",
"default": "answer_similarity"
},
"answer_similarity": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"title": "BasicScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"type"
"type",
"answer_similarity"
],
"title": "AnswerSimilarityScoringFnParams"
},
@ -6505,150 +6529,234 @@
"ContextEntityRecallScoringFnParams": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "context_entity_recall",
"default": "context_entity_recall"
},
"context_entity_recall": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"title": "BasicScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"type"
"type",
"context_entity_recall"
],
"title": "ContextEntityRecallScoringFnParams"
},
"ContextPrecisionScoringFnParams": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "context_precision",
"default": "context_precision"
},
"context_precision": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"title": "BasicScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"type"
"type",
"context_precision"
],
"title": "ContextPrecisionScoringFnParams"
},
"ContextRecallScoringFnParams": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "context_recall",
"default": "context_recall"
},
"context_recall": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"title": "BasicScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"type"
"type",
"context_recall"
],
"title": "ContextRecallScoringFnParams"
},
"ContextRelevancyScoringFnParams": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "context_relevancy",
"default": "context_relevancy"
},
"context_relevancy": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"title": "BasicScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"type"
"type",
"context_relevancy"
],
"title": "ContextRelevancyScoringFnParams"
},
"CustomLLMAsJudgeScoringFnParams": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "custom_llm_as_judge",
"default": "custom_llm_as_judge"
},
"custom_llm_as_judge": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "custom_llm_as_judge",
"default": "custom_llm_as_judge"
},
"judge_model": {
"type": "string"
},
"prompt_template": {
"type": "string"
},
"judge_score_regexes": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"type",
"judge_model"
],
"title": "CustomLLMAsJudgeScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"type",
"custom_llm_as_judge"
],
"title": "CustomLLMAsJudgeScoringFnParams"
},
"EqualityScoringFnParams": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "equality",
"default": "equality"
},
"equality": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"title": "BasicScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"type"
"type",
"equality"
],
"title": "EqualityScoringFnParams"
},
@ -6672,104 +6780,78 @@
"FactualityScoringFnParams": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "factuality",
"default": "factuality"
},
"factuality": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"title": "BasicScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"type"
"type",
"factuality"
],
"title": "FactualityScoringFnParams"
},
"FaithfulnessScoringFnParams": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "faithfulness",
"default": "faithfulness"
}
},
"additionalProperties": false,
"required": [
"type"
],
"title": "FaithfulnessScoringFnParams"
},
"LLMAsJudgeScoringFnParams": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "custom_llm_as_judge",
"default": "custom_llm_as_judge"
},
"judge_model": {
"type": "string"
},
"prompt_template": {
"type": "string"
},
"judge_score_regexes": {
"type": "array",
"items": {
"type": "string"
}
},
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
}
"faithfulness": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"title": "BasicScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"type",
"judge_model"
"faithfulness"
],
"title": "LLMAsJudgeScoringFnParams"
"title": "FaithfulnessScoringFnParams"
},
"ModelCandidate": {
"type": "object",
@ -6804,83 +6886,103 @@
"RegexParserMathScoringFnParams": {
"type": "object",
"properties": {
"parsing_regexes": {
"type": "array",
"items": {
"type": "string"
},
"description": "(Optional) Regexes to extract the answer from generated response."
},
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "regex_parser_math_response",
"default": "regex_parser_math_response"
},
"regex_parser_math_response": {
"type": "object",
"properties": {
"parsing_regexes": {
"type": "array",
"items": {
"type": "string"
},
"description": "(Optional) Regexes to extract the answer from generated response."
},
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"required": [
"parsing_regexes"
],
"title": "RegexParserScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"parsing_regexes",
"type"
"type",
"regex_parser_math_response"
],
"title": "RegexParserMathScoringFnParams"
},
"RegexParserScoringFnParams": {
"type": "object",
"properties": {
"parsing_regexes": {
"type": "array",
"items": {
"type": "string"
},
"description": "(Optional) Regexes to extract the answer from generated response."
},
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "regex_parser",
"default": "regex_parser"
},
"regex_parser": {
"type": "object",
"properties": {
"parsing_regexes": {
"type": "array",
"items": {
"type": "string"
},
"description": "(Optional) Regexes to extract the answer from generated response."
},
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"required": [
"parsing_regexes"
],
"title": "RegexParserScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"parsing_regexes",
"type"
"type",
"regex_parser"
],
"title": "RegexParserScoringFnParams"
},
"ScoringFnParams": {
"oneOf": [
{
"$ref": "#/components/schemas/LLMAsJudgeScoringFnParams"
"$ref": "#/components/schemas/CustomLLMAsJudgeScoringFnParams"
},
{
"$ref": "#/components/schemas/RegexParserScoringFnParams"
@ -6925,7 +7027,7 @@
"discriminator": {
"propertyName": "type",
"mapping": {
"custom_llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams",
"custom_llm_as_judge": "#/components/schemas/CustomLLMAsJudgeScoringFnParams",
"regex_parser": "#/components/schemas/RegexParserScoringFnParams",
"regex_parser_math_response": "#/components/schemas/RegexParserMathScoringFnParams",
"equality": "#/components/schemas/EqualityScoringFnParams",
@ -6945,30 +7047,38 @@
"SubsetOfcoringFnParams": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
},
"type": {
"type": "string",
"const": "subset_of",
"default": "subset_of"
},
"subset_of": {
"type": "object",
"properties": {
"aggregation_functions": {
"type": "array",
"items": {
"type": "string",
"enum": [
"average",
"median",
"categorical_count",
"accuracy"
],
"title": "AggregationFunctionType",
"description": "A type of aggregation function."
},
"description": "(Optional) Aggregation functions to apply to the scores of each row. If not provided, no aggregation will be performed."
}
},
"additionalProperties": false,
"title": "BasicScoringFnParamsFields"
}
},
"additionalProperties": false,
"required": [
"type"
"type",
"subset_of"
],
"title": "SubsetOfcoringFnParams"
},