mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-30 17:13:15 +00:00
(feat:file_abstract) process files method
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Base storage class for file system abstraction."""
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import BinaryIO, List
|
||||
from typing import BinaryIO, List, Optional, Callable
|
||||
|
||||
|
||||
class BaseStorage(ABC):
|
||||
@@ -33,6 +33,24 @@ class BaseStorage(ABC):
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def process_file(self, path: str, processor_func: Callable, **kwargs):
|
||||
"""
|
||||
Process a file using the provided processor function.
|
||||
|
||||
This method handles the details of retrieving the file and providing
|
||||
it to the processor function in an appropriate way based on the storage type.
|
||||
|
||||
Args:
|
||||
path: Path to the file
|
||||
processor_func: Function that processes the file
|
||||
**kwargs: Additional arguments to pass to the processor function
|
||||
|
||||
Returns:
|
||||
The result of the processor function
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def delete_file(self, path: str) -> bool:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user