error_artifact

Bases: BaseArtifact

Attributes

NameTypeDescription
valuestrThe error message.
exceptionOptional[Exception]The exception that caused the error. Defaults to None.
Source Code in griptape/artifacts/error_artifact.py
@define
class ErrorArtifact(BaseArtifact):
    """Represents an error that may want to be conveyed to the LLM.

    Attributes:
        value: The error message.
        exception: The exception that caused the error. Defaults to None.
    """

    value: str = field(converter=str, metadata={"serializable": True})
    exception: Optional[Exception] = field(default=None, kw_only=True, metadata={"serializable": False})

    def to_text(self) -> str:
        return self.value
  • exception = field(default=None, kw_only=True, metadata={'serializable': False}) class-attribute instance-attribute

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

to_text()

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

Could this page be better? Report a problem or suggest an addition!