awacke1 commited on
Commit
008db5b
·
verified ·
1 Parent(s): 3780a02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -316,8 +316,10 @@ def gen_AI_IO_filename(display_query, output):
316
  now_central = datetime.now(pytz.timezone("America/Chicago"))
317
  timestamp = now_central.strftime("%Y-%m-%d-%I-%M-%S-%f-%p")
318
 
319
- # Limit output to first 180 characters and clean up any invalid filename characters
320
- output_snippet = re.sub(r'[^A-Za-z0-9]+', '_', output[:180])
 
 
321
  filename = f"{timestamp} - {display_query} - {output_snippet}.md"
322
  return filename
323
 
 
316
  now_central = datetime.now(pytz.timezone("America/Chicago"))
317
  timestamp = now_central.strftime("%Y-%m-%d-%I-%M-%S-%f-%p")
318
 
319
+ # Limit components to prevent excessive filename length
320
+ display_query = display_query[:50] # Truncate display_query to 50 chars
321
+ output_snippet = re.sub(r'[^A-Za-z0-9]+', '_', output[:100]) # Truncate output_snippet to 100 chars
322
+
323
  filename = f"{timestamp} - {display_query} - {output_snippet}.md"
324
  return filename
325