class BaseLoader(ABC):
Abstract base class for all data loaders in CAMEL.
def _load_single(self, source: Union[str, Path]):
Load data from a single source.
Parameters:
Returns:
Dict[str, Any]: A dictionary containing the loaded data. It is recommended that the dictionary includes a “content” key with the primary data and optional metadata keys.
def load(self, source: Union[str, Path, List[Union[str, Path]]]):
Load data from one or multiple sources.
Parameters:
Returns:
Dict[str, List[Dict[str, Any]]]: A dictionary with a single key “contents” containing a list of loaded data. If a single source is provided, the list will contain a single item.
def supported_formats(self):
Returns:
set[str]: A set of strings representing the supported formats/ sources.