Skip to content

Commit

Permalink
Use str, Enum to achieve what StrEnum does so that we are compatible …
Browse files Browse the repository at this point in the history
…with older versions of Python.
  • Loading branch information
hemang1729 committed Dec 12, 2024
1 parent 9c90231 commit a0bd16a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 27 deletions.
1 change: 0 additions & 1 deletion .github/workflows/testing_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ permissions:

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand Down
4 changes: 2 additions & 2 deletions testing/invariant/custom_types/matchers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Defines the expect functions."""

from enum import StrEnum
from enum import Enum
from typing import Any

from invariant.scorers.llm.classifier import Classifier
Expand Down Expand Up @@ -86,7 +86,7 @@ def matches(self, actual_value: str):
class IsFactuallyEqual(Matcher):
"""Matcher for checking if the output is close to expected using llm."""

class Agreement(StrEnum):
class Agreement(str, Enum):
"""Enum for different levels of agreement."""

SUPER_STRICT_AGREEMENT = "super strict agreement"
Expand Down
4 changes: 2 additions & 2 deletions testing/invariant/scorers/llm/clients/client.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Abstract base class for LLM clients."""

from abc import ABC, abstractmethod
from enum import StrEnum
from enum import Enum
from typing import Any


class SupportedClients(StrEnum):
class SupportedClients(str, Enum):
"""Enumeration of supported LLM clients."""

OPENAI = "OpenAI"
Expand Down
44 changes: 22 additions & 22 deletions testing/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a0bd16a

Please sign in to comment.