Skip to content

Info artifact

InfoArtifact

Bases: BaseArtifact

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

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

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

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

        return dict(InfoArtifactSchema().dump(self))

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

__add__(other)

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

to_dict()

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

    return dict(InfoArtifactSchema().dump(self))

to_text()

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