isayahc commited on
Commit
bd2f975
1 Parent(s): a801eec

fixed mildtypo

Browse files
Files changed (2) hide show
  1. app.py +3 -2
  2. google_buckets.py +11 -10
app.py CHANGED
@@ -49,14 +49,15 @@ def generate_apparatus(input_text, retriever_choice):
49
  component_collection = weaviate_client.collections.get("Component")
50
 
51
  bucket_name = os.getenv('GOOGLE_BUCKET_NAME')
52
- manager = CloudStorageManager(bucket_name)
53
 
54
  bucket_name = os.getenv('GOOGLE_BUCKET_NAME')
55
 
56
  credentials_str = SERVICE_ACOUNT_STUFF = os.getenv('GOOGLE_APPLICATION_CREDENTIALS_JSON')
57
 
58
  # Create an instance of CloudStorageManager
59
- storage_manager = CloudStorageManager(bucket_name, credentials_str)
 
60
 
61
  for i in app_components:
62
 
 
49
  component_collection = weaviate_client.collections.get("Component")
50
 
51
  bucket_name = os.getenv('GOOGLE_BUCKET_NAME')
52
+ # manager = CloudStorageManager(bucket_name)
53
 
54
  bucket_name = os.getenv('GOOGLE_BUCKET_NAME')
55
 
56
  credentials_str = SERVICE_ACOUNT_STUFF = os.getenv('GOOGLE_APPLICATION_CREDENTIALS_JSON')
57
 
58
  # Create an instance of CloudStorageManager
59
+ manager = CloudStorageManager(bucket_name, credentials_str)
60
+
61
 
62
  for i in app_components:
63
 
google_buckets.py CHANGED
@@ -36,7 +36,6 @@ class CloudStorageManager:
36
 
37
  def main():
38
  # Replace 'your_bucket_name' with your actual bucket name
39
- bucket_name = os.getenv('GOOGLE_BUCKET_NAME')
40
 
41
  # Replace 'your_credentials_str' with your actual credentials string
42
  # credentials_str = """
@@ -54,6 +53,8 @@ def main():
54
  # }
55
  # """
56
 
 
 
57
  credentials_str = SERVICE_ACOUNT_STUFF = os.getenv('GOOGLE_APPLICATION_CREDENTIALS_JSON')
58
 
59
  # Create an instance of CloudStorageManager
@@ -61,21 +62,21 @@ def main():
61
 
62
  # Example usage:
63
  # Upload a file
64
- storage_manager.upload_file('local_file_path', 'destination_file_name')
65
 
66
  # Download a file
67
- storage_manager.download_file('source_file_name', 'local_destination_path')
68
 
69
  # Delete a file
70
- storage_manager.delete_file('file_name_to_delete')
71
 
72
  # Get file by UUID
73
- uuid = 'your_uuid'
74
- file_name = storage_manager.get_file_by_uuid(uuid)
75
- if file_name:
76
- print(f"File with UUID '{uuid}' found: {file_name}")
77
- else:
78
- print(f"No file found with UUID '{uuid}'")
79
 
80
 
81
  if __name__ == "__main__":
 
36
 
37
  def main():
38
  # Replace 'your_bucket_name' with your actual bucket name
 
39
 
40
  # Replace 'your_credentials_str' with your actual credentials string
41
  # credentials_str = """
 
53
  # }
54
  # """
55
 
56
+ bucket_name = os.getenv('GOOGLE_BUCKET_NAME')
57
+
58
  credentials_str = SERVICE_ACOUNT_STUFF = os.getenv('GOOGLE_APPLICATION_CREDENTIALS_JSON')
59
 
60
  # Create an instance of CloudStorageManager
 
62
 
63
  # Example usage:
64
  # Upload a file
65
+ # storage_manager.upload_file('local_file_path', 'destination_file_name')
66
 
67
  # Download a file
68
+ # storage_manager.download_file('source_file_name', 'local_destination_path')
69
 
70
  # Delete a file
71
+ # storage_manager.delete_file('file_name_to_delete')
72
 
73
  # Get file by UUID
74
+ # uuid = 'your_uuid'
75
+ # file_name = storage_manager.get_file_by_uuid(uuid)
76
+ # if file_name:
77
+ # print(f"File with UUID '{uuid}' found: {file_name}")
78
+ # else:
79
+ # print(f"No file found with UUID '{uuid}'")
80
 
81
 
82
  if __name__ == "__main__":