Skip to content

Commit

Permalink
fix: implement backwards-compatible StrEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
tonykchen committed Apr 8, 2024
1 parent 289f57d commit 7d8072b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/agenteval/evaluators/aws/bedrock/claude/claude_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
from agenteval.evaluators.aws.bedrock.claude import model_configs
from agenteval.test_result import TestResult

# enable backwards-compatible StrEnum
try:
from enum import StrEnum
except ImportError:
from enum import Enum

class StrEnum(str, Enum):
pass


logger = logging.getLogger(__name__)

_PROMPT_TEMPLATE_ROOT = "evaluators/claude"
Expand All @@ -30,6 +20,15 @@ class StrEnum(str, Enum):
"generate_evaluation",
]

# enable backwards-compatible StrEnum
try:
from enum import StrEnum
except ImportError:
from enum import Enum

class StrEnum(str, Enum):
pass


class TestStatusCategories(StrEnum):
ALL_STEPS_ATTEMPTED = "A"
Expand Down

0 comments on commit 7d8072b

Please sign in to comment.