You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: agentplatform/_genai/types/common.py
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1873,6 +1873,10 @@ class Metric(_common.BaseModel):
1873
1873
default=None,
1874
1874
description="""The resource name of the metric definition. Example: projects/{project}/locations/{location}/evaluationMetrics/{evaluation_metric_id}""",
1875
1875
)
1876
+
result_parsing_function: Optional[str] = Field(
1877
+
default=None,
1878
+
description="""Optional. A Python function string used to parse the raw output of the LLM judge model. The function must be named `parse_results` and accept a list of model response strings. It should return a dictionary with `score` (float) and `explanation` (str) keys.""",
1879
+
)
1876
1880
1877
1881
# Allow extra fields to support metric-specific config fields.
1878
1882
model_config = ConfigDict(extra="allow")
@@ -1959,6 +1963,11 @@ class LLMMetric(Metric):
1959
1963
description="""Optional. The name of the column in the EvaluationDataset containing the list of rubrics to use for this metric.""",
1960
1964
)
1961
1965
1966
+
result_parsing_function: Optional[str] = Field(
1967
+
default=None,
1968
+
description="""Optional. A Python function string used to parse the raw output of the LLM judge model. The function must be named `parse_results` and accept a list of model response strings. It should return a dictionary with `score` (float) and `explanation` (str) keys.""",
@@ -2100,6 +2109,9 @@ class MetricDict(TypedDict, total=False):
2100
2109
metric_resource_name: Optional[str]
2101
2110
"""The resource name of the metric definition. Example: projects/{project}/locations/{location}/evaluationMetrics/{evaluation_metric_id}"""
2102
2111
2112
+
result_parsing_function: Optional[str]
2113
+
"""Optional. A Python function string used to parse the raw output of the LLM judge model. The function must be named `parse_results` and accept a list of model response strings. It should return a dictionary with `score` (float) and `explanation` (str) keys."""
Copy file name to clipboardExpand all lines: vertexai/_genai/types/common.py
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1866,6 +1866,11 @@ class LLMMetric(Metric):
1866
1866
description="""Optional. The name of the column in the EvaluationDataset containing the list of rubrics to use for this metric.""",
1867
1867
)
1868
1868
1869
+
result_parsing_function: Optional[str] = Field(
1870
+
default=None,
1871
+
description="""Optional. A Python function string used to parse the raw output of the LLM judge model. The function must be named `parse_results` and accept a list of model response strings. It should return a dictionary with `score` (float) and `explanation` (str) keys.""",
@@ -2007,6 +2012,9 @@ class MetricDict(TypedDict, total=False):
2007
2012
metric_resource_name: Optional[str]
2008
2013
"""The resource name of the metric definition. Example: projects/{project}/locations/{location}/evaluationMetrics/{evaluation_metric_id}"""
2009
2014
2015
+
result_parsing_function: Optional[str]
2016
+
"""Optional. A Python function string used to parse the raw output of the LLM judge model. The function must be named `parse_results` and accept a list of model response strings. It should return a dictionary with `score` (float) and `explanation` (str) keys."""
0 commit comments