mirror of
https://github.com/langgenius/dify.git
synced 2026-03-05 07:37:07 +08:00
23 lines
401 B
Python
23 lines
401 B
Python
from abc import ABC, abstractmethod
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass
|
|
class AssetItem(ABC):
|
|
asset_id: str
|
|
path: str
|
|
file_name: str
|
|
extension: str
|
|
|
|
@abstractmethod
|
|
def get_storage_key(self) -> str:
|
|
raise NotImplementedError
|
|
|
|
|
|
@dataclass
|
|
class FileAsset(AssetItem):
|
|
storage_key: str
|
|
|
|
def get_storage_key(self) -> str:
|
|
return self.storage_key
|