🚨(summary) lint backend sources
Run ruff format to fix linter warnings.
This commit is contained in:
committed by
aleb_the_flash
parent
8d1f01645a
commit
e816475981
@@ -64,9 +64,9 @@ def format_segments(transcription_data):
|
|||||||
conversation with speaker labels.
|
conversation with speaker labels.
|
||||||
"""
|
"""
|
||||||
formatted_output = ""
|
formatted_output = ""
|
||||||
if not transcription_data or not hasattr(transcription_data, 'segments'):
|
if not transcription_data or not hasattr(transcription_data, "segments"):
|
||||||
if isinstance(transcription_data, dict) and 'segments' in transcription_data:
|
if isinstance(transcription_data, dict) and "segments" in transcription_data:
|
||||||
segments = transcription_data['segments']
|
segments = transcription_data["segments"]
|
||||||
else:
|
else:
|
||||||
return "Error: Invalid transcription data format"
|
return "Error: Invalid transcription data format"
|
||||||
else:
|
else:
|
||||||
@@ -75,8 +75,8 @@ def format_segments(transcription_data):
|
|||||||
previous_speaker = None
|
previous_speaker = None
|
||||||
|
|
||||||
for segment in segments:
|
for segment in segments:
|
||||||
speaker = segment.get('speaker', 'UNKNOWN_SPEAKER')
|
speaker = segment.get("speaker", "UNKNOWN_SPEAKER")
|
||||||
text = segment.get('text', '')
|
text = segment.get("text", "")
|
||||||
if text:
|
if text:
|
||||||
if speaker != previous_speaker:
|
if speaker != previous_speaker:
|
||||||
formatted_output += f"\n\n **{speaker}**: {text}"
|
formatted_output += f"\n\n **{speaker}**: {text}"
|
||||||
@@ -85,6 +85,7 @@ def format_segments(transcription_data):
|
|||||||
previous_speaker = speaker
|
previous_speaker = speaker
|
||||||
return formatted_output
|
return formatted_output
|
||||||
|
|
||||||
|
|
||||||
def post_with_retries(url, data):
|
def post_with_retries(url, data):
|
||||||
"""Send POST request with automatic retries."""
|
"""Send POST request with automatic retries."""
|
||||||
session = create_retry_session()
|
session = create_retry_session()
|
||||||
@@ -236,5 +237,3 @@ def process_audio_transcribe_summarize_v2(filename: str, email: str, sub: str):
|
|||||||
logger.debug("Response body: %s", response.text)
|
logger.debug("Response body: %s", response.text)
|
||||||
|
|
||||||
# TODO - integrate summarize the transcript and create a new document.
|
# TODO - integrate summarize the transcript and create a new document.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user