This commit is contained in:
Xi Yan 2025-03-11 22:46:52 -07:00
parent f9ea90c4f7
commit 58d9cb1276
3 changed files with 17 additions and 8 deletions

View file

@ -7201,11 +7201,11 @@
"context_recall", "context_recall",
"context_relevancy" "context_relevancy"
], ],
"title": "ScoringFunctionType", "description": "The type of scoring function."
"description": "A type of scoring function. Each type is a criteria for evaluating answers."
}, },
"params": { "params": {
"$ref": "#/components/schemas/ScoringFnParams" "$ref": "#/components/schemas/ScoringFnParams",
"description": "(Optional) The parameters for the scoring function."
}, },
"metadata": { "metadata": {
"type": "object", "type": "object",
@ -7230,7 +7230,8 @@
"type": "object" "type": "object"
} }
] ]
} },
"description": "(Optional) Any additional metadata for this definition (e.g. description)."
} }
}, },
"additionalProperties": false, "additionalProperties": false,

View file

@ -4976,11 +4976,11 @@ components:
- context_precision - context_precision
- context_recall - context_recall
- context_relevancy - context_relevancy
title: ScoringFunctionType description: The type of scoring function.
description: >-
A type of scoring function. Each type is a criteria for evaluating answers.
params: params:
$ref: '#/components/schemas/ScoringFnParams' $ref: '#/components/schemas/ScoringFnParams'
description: >-
(Optional) The parameters for the scoring function.
metadata: metadata:
type: object type: object
additionalProperties: additionalProperties:
@ -4991,6 +4991,8 @@ components:
- type: string - type: string
- type: array - type: array
- type: object - type: object
description: >-
(Optional) Any additional metadata for this definition (e.g. description).
additionalProperties: false additionalProperties: false
required: required:
- identifier - identifier

View file

@ -153,9 +153,15 @@ ScoringFnParams = register_schema(
class CommonScoringFnFields(BaseModel): class CommonScoringFnFields(BaseModel):
"""
:param scoring_fn_type: The type of scoring function.
:param params: (Optional) The parameters for the scoring function.
:param metadata: (Optional) Any additional metadata for this definition (e.g. description).
"""
scoring_fn_type: ScoringFunctionType scoring_fn_type: ScoringFunctionType
params: Optional[ScoringFnParams] = Field( params: Optional[ScoringFnParams] = Field(
description="The parameters for the scoring function for benchmark eval, these can be overridden for app eval", description="The parameters for the scoring function.",
default=None, default=None,
) )
metadata: Dict[str, Any] = Field( metadata: Dict[str, Any] = Field(