add_file.py
Source: sunholo/gcs/add_file.py
Functions
add_file_to_gcs(filename: str, vector_name: str = None, bucket_name: str = None, metadata: dict = None, bucket_filepath: str = None)
No docstring available.
handle_base64_image(base64_data: str, vector_name: str, extension: str)
Handle base64 image data, decode it, save it as a file, upload it to GCS, and return the image URI and MIME type.
Args: base64_data (str): The base64 encoded image data. vector_name (str): The vector name for the GCS path. extension (str): The file extension of the image (e.g., ".jpg", ".png").
Returns: Tuple[str, str]: The URI of the uploaded image and the MIME type.
get_summary_file_name(object_id)
No docstring available.
get_image_file_name(object_id, image_name, mime_type)
No docstring available.
get_pdf_split_file_name(object_id, part_name)
No docstring available.
add_folder_to_gcs(source_folder: str, vector_name: str = None, bucket_name: str = None, metadata: dict = None, bucket_folderpath: str = None)
Uploads a folder and all its contents to a specified GCS bucket.
resolve_bucket(vector_name)
No docstring available.