You are viewing a single comment's thread from:

RE: LeoThread 2024-09-29 11:04

in LeoFinance4 months ago

Improvement Stage 1: Error Handling and User Input

Enhancements

You introduced error handling for summarization, allowing the application to retry upon failure. Additionally, you enabled users to quit or retry if an error persisted.

while True:
    try:
        summary = summarize_transcript(transcript)
        break  # Exit the loop if successful
    except Exception as e:
        user_input = input("Press any key to retry or type 'q' to quit: ").strip().lower()
        if user_input in ['q', 'quit']:
            sys.exit()