Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion backend/routers/developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ class CreateConversationFromTranscriptRequest(BaseModel):

def _add_speaker_names_to_segments(uid, conversations: list):
"""Add speaker_name to transcript segments based on person_id mappings."""
user_profile = users_db.get_user_profile(uid)
user_name = user_profile.get('name') or 'User'

all_person_ids = set()
for conv in conversations:
for seg in conv.get('transcript_segments', []):
Expand All @@ -710,7 +713,7 @@ def _add_speaker_names_to_segments(uid, conversations: list):
for conv in conversations:
for seg in conv.get('transcript_segments', []):
if seg.get('is_user'):
seg['speaker_name'] = 'User'
seg['speaker_name'] = user_name
elif seg.get('person_id') and seg['person_id'] in people_map:
seg['speaker_name'] = people_map[seg['person_id']]
else:
Expand Down
5 changes: 4 additions & 1 deletion backend/routers/mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ class SimpleTranscriptSegment(BaseModel):

def _add_speaker_names_to_segments(uid, conversations: list):
"""Add speaker_name to transcript segments based on person_id mappings."""
user_profile = users_db.get_user_profile(uid)
user_name = user_profile.get('name') or 'User'

all_person_ids = set()
for conv in conversations:
for seg in conv.get('transcript_segments', []):
Expand All @@ -123,7 +126,7 @@ def _add_speaker_names_to_segments(uid, conversations: list):
for conv in conversations:
for seg in conv.get('transcript_segments', []):
if seg.get('is_user'):
seg['speaker_name'] = 'User'
seg['speaker_name'] = user_name
elif seg.get('person_id') and seg['person_id'] in people_map:
seg['speaker_name'] = people_map[seg['person_id']]
else:
Expand Down
5 changes: 4 additions & 1 deletion backend/utils/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def _add_speaker_names_to_payload(uid, payload: dict):
if not segments:
return

user_profile = users_db.get_user_profile(uid)
user_name = user_profile.get('name') or 'User'

person_ids = [seg.get('person_id') for seg in segments if seg.get('person_id')]
people_map = {}
if person_ids:
Expand All @@ -46,7 +49,7 @@ def _add_speaker_names_to_payload(uid, payload: dict):

for seg in segments:
if seg.get('is_user'):
seg['speaker_name'] = 'User'
seg['speaker_name'] = user_name
elif seg.get('person_id') and seg['person_id'] in people_map:
seg['speaker_name'] = people_map[seg['person_id']]
else:
Expand Down