Skip to content

base_rule

BaseRule

Bases: ABC

Source code in griptape/rules/base_rule.py
@define(frozen=True)
class BaseRule(ABC):
    value: Any = field()

    def __str__(self) -> str:
        return self.to_text()

    @abstractmethod
    def to_text(self) -> str: ...

value: Any = field() class-attribute instance-attribute

__str__()

Source code in griptape/rules/base_rule.py
def __str__(self) -> str:
    return self.to_text()

to_text() abstractmethod

Source code in griptape/rules/base_rule.py
@abstractmethod
def to_text(self) -> str: ...