diff --git a/anjani/internal_plugins/spam_prediction.py b/anjani/internal_plugins/spam_prediction.py index dcdc8a531..86f2a7467 100644 --- a/anjani/internal_plugins/spam_prediction.py +++ b/anjani/internal_plugins/spam_prediction.py @@ -37,9 +37,7 @@ InlineKeyboardMarkup, Message, ) -from pydantic import BaseModel -from pydantic.functional_validators import field_validator - +from pydantic import BaseModel, validator from anjani import command, filters, listener, plugin, util from anjani.core.metrics import SpamPredictionStat @@ -56,7 +54,7 @@ class PredictionResult(BaseModel): spam_score: float ham_score: float - @field_validator("spam_score", "ham_score") + @validator("spam_score", "ham_score") def calc_score(cls, value: float) -> float: return value * 100 diff --git a/pyproject.toml b/pyproject.toml index 3ef98f8c0..b7a1d9430 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "anjani" -version = "2.14.11" +version = "2.14.12" description = "Telegram group management bot" license = "GPL-3.0-or-later" authors = [