You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/examples/artifacts/main.py

18 lines
405 B

5 months ago
from swarms import Artifact
# Example usage
artifact = Artifact(file_path="example.txt", file_type=".txt")
artifact.create("Initial content")
artifact.edit("First edit")
artifact.edit("Second edit")
artifact.save()
# Export to JSON
artifact.export_to_json("artifact.json")
# Import from JSON
imported_artifact = Artifact.import_from_json("artifact.json")
# # Get metrics
print(artifact.get_metrics())