archivartaunik commited on
Commit
3aba5cf
·
verified ·
1 Parent(s): e565d1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -40
app.py CHANGED
@@ -380,11 +380,11 @@ def ui_analyze(selected_idx: Optional[int], df: pd.DataFrame,
380
  return "Analysis finished but returned no text. Check model settings and file format."
381
  # Add a listening link at the end
382
  url = _recording_url(unique_id)
383
- return f"### Analysis result
384
 
385
  {text}
386
 
387
- **Recording:** {url}"
388
  except Exception as e:
389
  # Try to attach more error details
390
  msg = str(e)
@@ -532,14 +532,14 @@ def ui_analyze_calls_by_date(
532
 
533
  # Iterate filtered calls
534
  results_blocks: List[str] = [
535
- f"## Вынікі
536
  Дата: {(date_str or _today_str()).strip()}
537
 
538
  Фільтр: {t_from}–{t_to}{' | calltype=' + calltype if calltype else ''}
539
 
540
  Знойдзена званкоў: {total}
541
 
542
- ---"
543
  ]
544
  analyzed = 0
545
 
@@ -556,24 +556,16 @@ def ui_analyze_calls_by_date(
556
  except Exception as e:
557
  url = _recording_url(unique_id)
558
  results_blocks.append(
559
- f"### Call {i+1}
560
- "
561
- f"- UniqueId: {unique_id}
562
- "
563
- f"- Start: {row.get('Start','')}
564
- "
565
- f"- CallerId: {row.get('CallerId','')}
566
- "
567
- f"- Destination: {row.get('Destination','')}
568
- "
569
- f"- Duration: {row.get('Duration','')}
570
- "
571
- f"- Recording: {url}
572
-
573
- "
574
- f"**Памылка загрузкі аўдыё:** {e}
575
- "
576
- "---"
577
  )
578
  continue
579
 
@@ -600,26 +592,18 @@ def ui_analyze_calls_by_date(
600
  # Result block with listening URL
601
  url = _recording_url(unique_id)
602
  block = (
603
- f"### Call {i+1}
604
- "
605
- f"- UniqueId: {unique_id}
606
- "
607
- f"- Start: {row.get('Start','')}
608
- "
609
- f"- CallerId: {row.get('CallerId','')}
610
- "
611
- f"- Destination: {row.get('Destination','')}
612
- "
613
- f"- Duration: {row.get('Duration','')}
614
- "
615
- f"- Recording: {url}
616
-
617
- "
618
- f"**Analysis:**
619
 
620
  {text}
621
- "
622
- "---"
623
  )
624
  results_blocks.append(block)
625
  analyzed += 1
 
380
  return "Analysis finished but returned no text. Check model settings and file format."
381
  # Add a listening link at the end
382
  url = _recording_url(unique_id)
383
+ return f"""### Analysis result
384
 
385
  {text}
386
 
387
+ **Recording:** {url}"""
388
  except Exception as e:
389
  # Try to attach more error details
390
  msg = str(e)
 
532
 
533
  # Iterate filtered calls
534
  results_blocks: List[str] = [
535
+ f"""## Вынікі
536
  Дата: {(date_str or _today_str()).strip()}
537
 
538
  Фільтр: {t_from}–{t_to}{' | calltype=' + calltype if calltype else ''}
539
 
540
  Знойдзена званкоў: {total}
541
 
542
+ ---"""
543
  ]
544
  analyzed = 0
545
 
 
556
  except Exception as e:
557
  url = _recording_url(unique_id)
558
  results_blocks.append(
559
+ f"""### Call {i+1}
560
+ - UniqueId: {unique_id}
561
+ - Start: {row.get('Start','')}
562
+ - CallerId: {row.get('CallerId','')}
563
+ - Destination: {row.get('Destination','')}
564
+ - Duration: {row.get('Duration','')}
565
+ - Recording: {url}
566
+
567
+ **Памылка загрузкі аўдыё:** {e}
568
+ ---"""
 
 
 
 
 
 
 
 
569
  )
570
  continue
571
 
 
592
  # Result block with listening URL
593
  url = _recording_url(unique_id)
594
  block = (
595
+ f"""### Call {i+1}
596
+ - UniqueId: {unique_id}
597
+ - Start: {row.get('Start','')}
598
+ - CallerId: {row.get('CallerId','')}
599
+ - Destination: {row.get('Destination','')}
600
+ - Duration: {row.get('Duration','')}
601
+ - Recording: {url}
602
+
603
+ **Analysis:**
 
 
 
 
 
 
 
604
 
605
  {text}
606
+ ---"""
 
607
  )
608
  results_blocks.append(block)
609
  analyzed += 1