Skip to content

Commit 9ce00d5

Browse files
committed
address comments
1 parent d4bb162 commit 9ce00d5

7 files changed

Lines changed: 21 additions & 14 deletions

File tree

src/backend/core/api/viewsets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def start_room_recording(self, request, pk=None): # pylint: disable=unused-argu
363363
):
364364
try:
365365
MetadataCollectorService().start(recording)
366-
logger.info("Started MetadataCollectorService")
366+
logger.debug("Started MetadataCollectorService")
367367
except MetadataCollectorException:
368368
logger.warning("Failed to start MetadataCollectorService")
369369

src/backend/core/recording/event/notification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def _notify_summary_service(recording):
204204
.first()
205205
)
206206

207-
output_folder = settings.METADATA_COLLECTOR_AWS_S3_OUTPUT_FOLDER
207+
output_folder = settings.METADATA_COLLECTOR_OUTPUT_FOLDER
208208
metadata_filename = f"{output_folder}/{recording.id}-metadata.json"
209209

210210
if not owner_access:

src/backend/meet/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,9 +817,9 @@ class Base(Configuration):
817817
environ_name="METADATA_COLLECTOR_AGENT_NAME",
818818
environ_prefix=None,
819819
)
820-
METADATA_COLLECTOR_AWS_S3_OUTPUT_FOLDER = values.Value(
820+
METADATA_COLLECTOR_OUTPUT_FOLDER = values.Value(
821821
"metadata",
822-
environ_name="METADATA_COLLECTOR_AWS_S3_OUTPUT_FOLDER",
822+
environ_name="METADATA_COLLECTOR_OUTPUT_FOLDER",
823823
environ_prefix=None,
824824
)
825825

src/summary/summary/core/celery_worker.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,19 @@ def process_audio_transcribe_summarize_v2(
296296
recording_start_dt,
297297
recording_end_dt,
298298
)
299-
transcription = assignment_result.apply(
300-
{
301-
"segments": transcription.segments,
302-
"word_segments": transcription.word_segments,
303-
}
299+
transcription = assignment_result.rewrite_diarization(
300+
transcription = assignment_result.apply(transcription.model_dump())
304301
)
305302
except FileServiceException as exc:
306-
logger.error("Error reading metadata: %s. Skipping speaker assignment", exc)
303+
logger.error(
304+
"Error reading metadata for task %s; skipping speaker assignment. Error: %s",
305+
task_id, exc
306+
)
307+
except Exception as exc: # noqa: BLE001
308+
logger.exception(
309+
"assign_speakers failed for task %s; skipping speaker assignment. Error: %s",
310+
task_id, exc
311+
)
307312
else:
308313
logger.debug("Skipping assign_speakers")
309314

src/summary/summary/core/file_service.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ def read_json(self, object_name: str) -> dict:
244244
raise FileServiceException(
245245
"Unexpected error while reading JSON object."
246246
) from e
247+
except (json.JSONDecodeError, UnicodeDecodeError) as e:
248+
raise FileServiceException("Invalid JSON content.") from e
247249
finally:
248250
if response:
249251
response.close()

src/summary/summary/core/user_assign.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class AssignmentResult:
4646
assignments: list[SpeakerAssignment] = field(default_factory=list)
4747
unassigned_speakers: list[str] = field(default_factory=list)
4848

49-
def apply(self, diarization: dict[str, Any]) -> dict[str, Any]:
49+
def rewrite_diarization(self, diarization: dict[str, Any]) -> dict[str, Any]:
5050
"""Return a copy of diarization with speaker labels replaced by names.
5151
5252
Replaces `"speaker"` fields in segments and word_segments with the

src/summary/tests/unit/test_user_assign.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def test_replaces_speakers_in_segments_and_words(self):
492492
SpeakerAssignment("SPEAKER_01", "id-b", "Bob", 0.8),
493493
],
494494
)
495-
result = assignment.apply(diarization)
495+
result = assignment.rewrite_diarization(diarization)
496496

497497
assert result["segments"][0]["speaker"] == "Alice"
498498
assert result["segments"][0]["words"][0]["speaker"] == "Alice"
@@ -513,7 +513,7 @@ def test_unassigned_speakers_unchanged(self):
513513
],
514514
unassigned_speakers=["SPEAKER_02"],
515515
)
516-
result = assignment.apply(diarization)
516+
result = assignment.rewrite_diarization(diarization)
517517
assert result["segments"][0]["speaker"] == "SPEAKER_02"
518518

519519
def test_preserves_extra_keys(self):
@@ -523,6 +523,6 @@ def test_preserves_extra_keys(self):
523523
"language": "en",
524524
"custom_field": 42,
525525
}
526-
result = AssignmentResult().apply(diarization)
526+
result = AssignmentResult().rewrite_diarization(diarization)
527527
assert result["language"] == "en"
528528
assert result["custom_field"] == 42

0 commit comments

Comments
 (0)