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

View file

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

View file

@ -153,9 +153,15 @@ ScoringFnParams = register_schema(
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
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,
)
metadata: Dict[str, Any] = Field(