From 1de9cff7628803afa736f9eddb117e6960798225 Mon Sep 17 00:00:00 2001 From: Peter Howell Date: Fri, 29 Aug 2025 22:22:13 +0000 Subject: [PATCH] gpt --- gpt.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gpt.py b/gpt.py index a42b09b..884a066 100644 --- a/gpt.py +++ b/gpt.py @@ -250,7 +250,7 @@ def fetch_useful_info(save_attachments=True, folder_name='useful info ref'): -def process_useful_info(): +def process_useful_info(start=0, num=0): import re from pathlib import Path @@ -460,11 +460,23 @@ def process_useful_info(): except Exception as e: print('[warn] DB insert failed:', e) + # Interactive prompts if parameters not provided + try: + if not start: + inp = input('Start group index (1-based, e.g., 1): ').strip() + start = int(inp) if inp else 1 + if not num: + inp = input('How many groups to process (e.g., 10, -1 for all): ').strip() + num = int(inp) if inp else -1 + except Exception: + start = start or 1 + num = num or -1 + for_each_group( log_path="cache/email_usefulinfo_sorted.txt", f=demo_f, - start=101, # change to resume at Nth group - count=150 + start=start, + count=num )