diff --git a/README.md b/README.md index caa86593..331c18af 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,10 @@ - [x] New input box in the conversation menu (April 2025) - [x] Add triggerable actions / tools (webhook) (April 2025) - [x] Agent optimisations (May 2025) -- [ ] Anthropic Tool compatibility (June 2025) -- [ ] MCP support (June 2025) -- [ ] Add OAuth 2.0 authentication for tools and sources (July 2025) +- [ ] Filesystem sources update (July 2025) +- [ ] Anthropic Tool compatibility (July 2025) +- [ ] MCP support (July 2025) +- [ ] Add OAuth 2.0 authentication for tools and sources (August 2025) - [ ] Agent scheduling You can find our full roadmap [here](https://github.com/orgs/arc53/projects/2). Please don't hesitate to contribute or create issues, it helps us improve DocsGPT! diff --git a/application/api/user/routes.py b/application/api/user/routes.py index fc052421..d4ef5f61 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -168,7 +168,7 @@ def handle_image_upload( filename = secure_filename(file.filename) upload_path = f"{settings.UPLOAD_FOLDER.rstrip('/')}/{user}/{base_path.rstrip('/')}/{uuid.uuid4()}_{filename}" try: - storage.save_file(file, upload_path) + storage.save_file(file, upload_path, storage_class="STANDARD") image_url = upload_path except Exception as e: current_app.logger.error(f"Error uploading image: {e}") diff --git a/application/storage/base.py b/application/storage/base.py index 273e7761..07f33c7b 100644 --- a/application/storage/base.py +++ b/application/storage/base.py @@ -1,4 +1,5 @@ """Base storage class for file system abstraction.""" + from abc import ABC, abstractmethod from typing import BinaryIO, List, Callable @@ -7,7 +8,7 @@ class BaseStorage(ABC): """Abstract base class for storage implementations.""" @abstractmethod - def save_file(self, file_data: BinaryIO, path: str) -> dict: + def save_file(self, file_data: BinaryIO, path: str, **kwargs) -> dict: """ Save a file to storage. diff --git a/application/storage/s3.py b/application/storage/s3.py index 7a52dd1c..1babb843 100644 --- a/application/storage/s3.py +++ b/application/storage/s3.py @@ -38,9 +38,17 @@ class S3Storage(BaseStorage): region_name=region_name, ) - def save_file(self, file_data: BinaryIO, path: str) -> dict: + def save_file( + self, + file_data: BinaryIO, + path: str, + storage_class: str = "INTELLIGENT_TIERING", + **kwargs, + ) -> dict: """Save a file to S3 storage.""" - self.s3.upload_fileobj(file_data, self.bucket_name, path) + self.s3.upload_fileobj( + file_data, self.bucket_name, path, ExtraArgs={"StorageClass": storage_class} + ) region = getattr(settings, "SAGEMAKER_REGION", None)