tools/datagen-bq-to-bq/file_processing_utils.py [65:115]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        content.role = "user"  # Set the role to "user"
        predicted_schema = gemini_model.generate_content([content]).text
        table_schema = predicted_schema.replace("```json\n", "").replace("```", "")
        table_attributes[table_name]["schema"] = table_schema

        # Extract the column names from the schema
        column_names = extract_column_names(table_schema)
        table_attributes[table_name]["column_names"] = column_names

        # Add the column names to the file, only if the header is not present in the source file
        if not (safe_strtobool(header_flag.strip())):
            # Append the column names to the file for further processing
            table_staging_path = gcs_ops.append_header_to_gcs_file(
                gcs_path, staging_gcs_path, column_names
            )
            table_attributes[table_name]["staging_gcs_path"] = table_staging_path

        if safe_strtobool(header_flag.strip()):
            table_staging_path = gcs_ops.append_header_to_gcs_file(
                gcs_path, staging_gcs_path, None
            )
            table_attributes[table_name]["staging_gcs_path"] = table_staging_path

        # Extracting the Delimiter of the File
        file_delimiter = gcs_ops.read_gcs_return_delimiter(gcs_path, gemini_model)
        # Add a delay to avoid exceeding the API request rate
        time.sleep(1)  # pause for 1 second
        file_delimiter = (
            file_delimiter.strip()
        )  # Remove leading/trailing whitespace, including newlines
        table_attributes[table_name]["delimiter"] = file_delimiter

    # Extracting the Header File Path, if present
    for table_name, gcs_path in header_gcs_path.items():
        # Check if the table_name exists in table_attributes before accessing it
        if table_name in table_attributes:
            table_attributes[table_name]["header_file_path"] = gcs_path
        else:
            # Handle the case where table_name is not found in table_attributes
            print(
                f"Warning: Table '{table_name}' not found in input_gcs_path. Skipping header file path assignment."
            )

    for table_name, gcs_path in input_gcs_path.items():
        # Check if the table_name exists in table_attributes before accessing it
        attributes = table_attributes.get(table_name)
        column_header_flag = attributes.get("column_header_flag")
        delimiter = attributes.get("delimiter")
        custom_header = attributes.get("custom_header")
        header_file_path = attributes.get("header_file_path")
        schema = attributes.get("schema")
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tools/datagen-gcs-to-gcs/file_processing_utils.py [88:138]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            content.role = "user"  # Set the role to "user"
            predicted_schema = gemini_model.generate_content([content]).text
            table_schema = predicted_schema.replace("```json\n", "").replace("```", "")
            table_attributes[table_name]["schema"] = table_schema

            # Extract the column names from the schema
            column_names = extract_column_names(table_schema)
            table_attributes[table_name]["column_names"] = column_names

        # Add the column names to the file, only if the header is not present in the source file
        if not (safe_strtobool(header_flag.strip())):
            # Append the column names to the file for further processing
            table_staging_path = gcs_ops.append_header_to_gcs_file(
                gcs_path, staging_gcs_path, column_names
            )
            table_attributes[table_name]["staging_gcs_path"] = table_staging_path

        if safe_strtobool(header_flag.strip()):
            table_staging_path = gcs_ops.append_header_to_gcs_file(
                gcs_path, staging_gcs_path, None
            )
            table_attributes[table_name]["staging_gcs_path"] = table_staging_path

        # Extracting the Delimiter of the File
        file_delimiter = gcs_ops.read_gcs_return_delimiter(gcs_path, gemini_model)
        # Add a delay to avoid exceeding the API request rate
        time.sleep(1)  # pause for 1 second
        file_delimiter = (
            file_delimiter.strip()
        )  # Remove leading/trailing whitespace, including newlines
        table_attributes[table_name]["delimiter"] = file_delimiter

    # Extracting the Header File Path, if present
    for table_name, gcs_path in header_gcs_path.items():
        # Check if the table_name exists in table_attributes before accessing it
        if table_name in table_attributes:
            table_attributes[table_name]["header_file_path"] = gcs_path
        else:
            # Handle the case where table_name is not found in table_attributes
            print(
                f"Warning: Table '{table_name}' not found in input_gcs_path. Skipping header file path assignment."
            )

    for table_name, gcs_path in input_gcs_path.items():
        # Check if the table_name exists in table_attributes before accessing it
        attributes = table_attributes.get(table_name)
        column_header_flag = attributes.get("column_header_flag")
        delimiter = attributes.get("delimiter")
        custom_header = attributes.get("custom_header")
        header_file_path = attributes.get("header_file_path")
        schema = attributes.get("schema")
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



