Add canonical audio preparation and meeting context support

This commit is contained in:
2026-08-24 10:22:16 +02:00
parent 8dab928763
commit d94436af43
14 changed files with 713 additions and 23 deletions
+32
View File
@@ -72,6 +72,38 @@ class MeetingContextTests(unittest.TestCase):
with self.assertRaisesRegex(MeetingContextValidationError, "invalid value"):
validate_meeting_context(data)
def test_missing_participant_attendance_defaults_to_present(self) -> None:
data = copy.deepcopy(self.context.data)
del data["participants"][0]["attendance_status"]
context = create_meeting_context(data)
self.assertEqual(
context.data["participants"][0]["attendance_status"], "present"
)
def test_explicit_mentioned_only_is_preserved(self) -> None:
data = copy.deepcopy(self.context.data)
data["mentioned_people"][0]["attendance_status"] = "mentioned_only"
context = create_meeting_context(data)
self.assertEqual(
context.data["mentioned_people"][0]["attendance_status"],
"mentioned_only",
)
self.assertIn(
"Mentioned but absent people:", render_meeting_context_for_prompt(context)
)
def test_mentioned_only_person_cannot_be_a_diarized_speaker(self) -> None:
data = copy.deepcopy(self.context.data)
mentioned_id = data["mentioned_people"][0]["person_id"]
data["speaker_mappings"] = {"SPEAKER_00": mentioned_id}
with self.assertRaisesRegex(MeetingContextValidationError, "unknown participant"):
validate_meeting_context(data)
def test_prompt_representation_is_deterministic(self) -> None:
first = render_meeting_context_for_prompt(self.context)
second = render_meeting_context_for_prompt(self.context)