Skip to content
Open
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
6 changes: 6 additions & 0 deletions echo/server/dembrane/api/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,12 @@ async def summarize_conversation(
language = conversation_data["project_id"]["language"]

if transcript_str == "":
# Update conversation in DB so has_empty_transcript is True, preventing infinite retries by the catch-up scheduler
await run_in_thread_pool(
conversation_service.update,
conversation_id=conversation_id,
has_empty_transcript=True,
)
return {
"status": "success",
"message": "Transcript is empty, so no summary was generated",
Expand Down
3 changes: 2 additions & 1 deletion echo/server/dembrane/conversation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def collect_unsummarized_conversations(limit: int = 50) -> List[str]:
"""
Collect conversations that are fully transcribed but missing a summary.

Simple check: is_all_chunks_transcribed = True AND summary = null.
Simple check: is_all_chunks_transcribed = True AND summary = null AND has_empty_transcript != True.
The transcribed flag is the source of truth for "ready for summarization".

Args:
Expand All @@ -150,6 +150,7 @@ def collect_unsummarized_conversations(limit: int = 50) -> List[str]:
"filter": {
"is_all_chunks_transcribed": True,
"summary": {"_null": True},
"has_empty_transcript": {"_neq": True},
"deleted_at": {"_null": True},
"created_at": {
"_lte": (get_utc_timestamp() - timedelta(minutes=5)).isoformat()
Expand Down
3 changes: 3 additions & 0 deletions echo/server/dembrane/service/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ def update(
is_finished: Any = _UNSET,
is_all_chunks_transcribed: Any = _UNSET,
is_over_cap: Any = _UNSET,
has_empty_transcript: Any = _UNSET,
) -> dict:
update_data: dict[str, Any] = {}
if participant_name is not _UNSET:
Expand All @@ -348,6 +349,8 @@ def update(
update_data["is_all_chunks_transcribed"] = is_all_chunks_transcribed
if is_over_cap is not _UNSET:
update_data["is_over_cap"] = is_over_cap
if has_empty_transcript is not _UNSET:
update_data["has_empty_transcript"] = has_empty_transcript

try:
with self._client_context() as client:
Expand Down
Loading