Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
penguine-ip committed Jan 9, 2025
1 parent a75dd4b commit 3f9ca06
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions deepeval/guardrails/base_guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,23 @@ def __name__(self):

class BaseGuard(BaseDecorativeGuard):
@abstractmethod
def guard(self, input: str, *args, **kwargs) -> float:
def guard_input(self, input: str, *args, **kwargs) -> float:
raise NotImplementedError

@abstractmethod
async def a_guard(self, input: str, *args, **kwargs) -> float:
async def a_guard_input(self, input: str, *args, **kwargs) -> float:
raise NotImplementedError(
f"Async execution for {self.__class__.__name__} not supported yet. Please set 'async_mode' to 'False'."
f"Async execution for {self.__class__.__name__} not supported yet."
)

@abstractmethod
def guard_response(self, input: str, *args, **kwargs) -> float:
raise NotImplementedError

@abstractmethod
async def a_guard_response(self, input: str, *args, **kwargs) -> float:
raise NotImplementedError(
f"Async execution for {self.__class__.__name__} not supported yet."
)

@property
Expand Down

0 comments on commit 3f9ca06

Please sign in to comment.