Skip to content

Commit 7f238fb

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: Add a warning message for scheduled deprecation of Coherence metric class
PiperOrigin-RevId: 658500900
1 parent cff8ae0 commit 7f238fb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

vertexai/preview/evaluation/metrics/_coherence.py

+9
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,25 @@
1515
# limitations under the License.
1616
#
1717
from typing import Optional
18+
import warnings
19+
1820
from vertexai.preview.evaluation import constants
1921
from vertexai.preview.evaluation.metrics import _base
2022

23+
_DEPRECATION_WARNING_MESSAGE = (
24+
"After google-cloud-aiplatform>1.63.0, using metric class `Coherence` will"
25+
" result in an error. Please use string metric name `coherence` or define"
26+
" a PointwiseMetric instead."
27+
)
28+
2129

2230
class Coherence(_base._ModelBasedMetric):
2331
"""The model-based pointwise metric for Coherence."""
2432

2533
_metric_name = constants.Metric.COHERENCE
2634

2735
def __init__(self, *, version: Optional[int] = None):
36+
warnings.warn(message=_DEPRECATION_WARNING_MESSAGE)
2837
super().__init__(
2938
metric=Coherence._metric_name,
3039
version=version,

0 commit comments

Comments
 (0)