Skip to content

Commit d674b15

Browse files
authored
fix(py/plugins/evaluators): fix strenum imports (#3944)
1 parent 252b835 commit d674b15

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

py/plugins/evaluators/pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ classifiers = [
3030
"Topic :: Scientific/Engineering :: Artificial Intelligence",
3131
"Topic :: Software Development :: Libraries",
3232
]
33-
dependencies = ["genkit", "jsonata-python>=0.5.3", "pydantic>=2.10.5"]
33+
dependencies = [
34+
"genkit",
35+
"jsonata-python>=0.5.3",
36+
"pydantic>=2.10.5",
37+
"strenum>=0.4.15; python_version < '3.11'",
38+
]
3439
description = "Genkit Evaluators Plugin for RAGAS"
3540
license = { text = "Apache-2.0" }
3641
name = "genkit-plugin-evaluators"

py/plugins/evaluators/src/genkit/plugins/evaluators/constant.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717

1818
from collections.abc import Callable
19-
from enum import StrEnum
19+
try:
20+
from enum import StrEnum
21+
except ImportError:
22+
from strenum import StrEnum
2023
from typing import Any
2124

2225
from pydantic import BaseModel, RootModel

py/uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)