__init__.py 724 B

1234567891011121314151617
  1. from openhands.storage.files import FileStore
  2. from openhands.storage.google_cloud import GoogleCloudFileStore
  3. from openhands.storage.local import LocalFileStore
  4. from openhands.storage.memory import InMemoryFileStore
  5. from openhands.storage.s3 import S3FileStore
  6. def get_file_store(file_store: str, file_store_path: str | None = None) -> FileStore:
  7. if file_store == 'local':
  8. if file_store_path is None:
  9. raise ValueError('file_store_path is required for local file store')
  10. return LocalFileStore(file_store_path)
  11. elif file_store == 's3':
  12. return S3FileStore()
  13. elif file_store == 'google_cloud':
  14. return GoogleCloudFileStore(file_store_path)
  15. return InMemoryFileStore()