Skip to content

Error artifact

ErrorArtifact

Bases: BaseArtifact

Source code in griptape/griptape/artifacts/error_artifact.py
@define(frozen=True)
class ErrorArtifact(BaseArtifact):
    value: str = field(converter=str)

    def __add__(self, other: ErrorArtifact) -> ErrorArtifact:
        return ErrorArtifact(self.value + other.value)

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

    def to_dict(self) -> dict:
        from griptape.schemas import ErrorArtifactSchema

        return dict(ErrorArtifactSchema().dump(self))

value: str = field(converter=str) class-attribute instance-attribute

__add__(other)

Source code in griptape/griptape/artifacts/error_artifact.py
def __add__(self, other: ErrorArtifact) -> ErrorArtifact:
    return ErrorArtifact(self.value + other.value)

to_dict()

Source code in griptape/griptape/artifacts/error_artifact.py
def to_dict(self) -> dict:
    from griptape.schemas import ErrorArtifactSchema

    return dict(ErrorArtifactSchema().dump(self))

to_text()

Source code in griptape/griptape/artifacts/error_artifact.py
def to_text(self) -> str:
    return self.value