Skip to content

generic_artifact

T = TypeVar('T') module-attribute

GenericArtifact

Bases: BaseArtifact, Generic[T]

Serves as an escape hatch for artifacts that don't fit into any other category.

Attributes:

Name Type Description
value T

The value of the Artifact.

Source code in griptape/artifacts/generic_artifact.py
@define
class GenericArtifact(BaseArtifact, Generic[T]):
    """Serves as an escape hatch for artifacts that don't fit into any other category.

    Attributes:
        value: The value of the Artifact.
    """

    value: T = field(metadata={"serializable": True})

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

value = field(metadata={'serializable': True}) class-attribute instance-attribute

to_text()

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