from laddr import override_system_tool, ArtifactStorageTool
@override_system_tool("system_store_artifact")
async def custom_storage(
data: dict,
artifact_type: str,
metadata: dict = None,
bucket: str = None,
_artifact_storage=None,
**kwargs
):
"""Custom artifact storage with compression."""
storage_tool = ArtifactStorageTool(
storage_backend=_artifact_storage,
default_bucket=bucket or "artifacts"
)
# Add custom logic (compression, encryption, etc.)
return await storage_tool.store_artifact(
data=data,
artifact_type=artifact_type,
metadata=metadata,
bucket=bucket
)