From 35e2461cfd468bb54d5c9d793b29cf3d9bd90d95 Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Fri, 13 Sep 2024 11:00:29 -0700 Subject: [PATCH] Fix more feedback --- griptape/artifacts/base_artifact.py | 2 +- griptape/artifacts/csv_row_artifact.py | 28 -------------------------- 2 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 griptape/artifacts/csv_row_artifact.py diff --git a/griptape/artifacts/base_artifact.py b/griptape/artifacts/base_artifact.py index 4321ae00bc..61989ab54a 100644 --- a/griptape/artifacts/base_artifact.py +++ b/griptape/artifacts/base_artifact.py @@ -16,7 +16,7 @@ class BaseArtifact(SerializableMixin, ABC): """Serves as the base class for all Artifacts. - Artifacts are used to store data that can be provided as input to, or received as output from, a language model (LLM). + Artifacts are used to encapsulate data and enhance it with metadata. Attributes: id: The unique identifier of the Artifact. Defaults to a random UUID. diff --git a/griptape/artifacts/csv_row_artifact.py b/griptape/artifacts/csv_row_artifact.py deleted file mode 100644 index eea01fc141..0000000000 --- a/griptape/artifacts/csv_row_artifact.py +++ /dev/null @@ -1,28 +0,0 @@ -from __future__ import annotations - -from typing import Any - -from attrs import define, field - -from griptape.artifacts import BaseArtifact, TextArtifact - - -@define -class CsvRowArtifact(TextArtifact): - """Stores a row of a CSV file. - - Attributes: - value: The row of the CSV file. If a dictionary is passed, the keys and values converted to a string. - """ - - value: str = field(converter=lambda value: CsvRowArtifact.value_to_str(value), metadata={"serializable": True}) - - def __add__(self, other: BaseArtifact) -> TextArtifact: - return TextArtifact(self.value + "\n" + other.value) - - @classmethod - def value_to_str(cls, value: Any) -> str: - if isinstance(value, dict): - return "\n".join(f"{key}: {val}" for key, val in value.items()) - else: - return str(value)