39 lines
1.0 KiB
Python
39 lines
1.0 KiB
Python
|
# scripts/script_x1.py
|
||
|
"""
|
||
|
Example script showing parameter handling and logging
|
||
|
"""
|
||
|
import argparse
|
||
|
from utils.logger_utils import setup_logger
|
||
|
from utils.file_utils import select_file, safe_read_excel
|
||
|
from services.llm.openai_service import OpenAIService
|
||
|
|
||
|
logger = setup_logger(__name__, "script_x1.log")
|
||
|
|
||
|
def process_file(input_file, llm_service):
|
||
|
logger.info(f"Processing file: {input_file}")
|
||
|
|
||
|
df = safe_read_excel(input_file)
|
||
|
if df is None:
|
||
|
return
|
||
|
|
||
|
# Example processing
|
||
|
for index, row in df.iterrows():
|
||
|
# Process each row
|
||
|
pass
|
||
|
|
||
|
logger.info("Processing complete")
|
||
|
|
||
|
def main(args):
|
||
|
input_file = args.input_file or select_file("Select input file")
|
||
|
if not input_file:
|
||
|
logger.error("No input file selected")
|
||
|
return
|
||
|
|
||
|
llm_service = OpenAIService()
|
||
|
process_file(input_file, llm_service)
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
parser = argparse.ArgumentParser()
|
||
|
parser.add_argument("--input-file", help="Path to input file")
|
||
|
args = parser.parse_args()
|
||
|
main(args)
|