mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-23 05:39:05 +00:00
self-review
This commit is contained in:
@@ -81,6 +81,7 @@ from reflector.utils.daily import (
|
|||||||
parse_daily_recording_filename,
|
parse_daily_recording_filename,
|
||||||
)
|
)
|
||||||
from reflector.utils.string import NonEmptyString, assert_non_none_and_non_empty
|
from reflector.utils.string import NonEmptyString, assert_non_none_and_non_empty
|
||||||
|
from reflector.utils.transcript_constants import TOPIC_CHUNK_WORD_COUNT
|
||||||
from reflector.zulip import post_transcript_notification
|
from reflector.zulip import post_transcript_notification
|
||||||
|
|
||||||
|
|
||||||
@@ -558,9 +559,6 @@ async def detect_topics(input: PipelineInput, ctx: Context) -> TopicsResult:
|
|||||||
TranscriptTopic,
|
TranscriptTopic,
|
||||||
transcripts_controller,
|
transcripts_controller,
|
||||||
)
|
)
|
||||||
from reflector.utils.transcript_constants import ( # noqa: PLC0415
|
|
||||||
TOPIC_CHUNK_WORD_COUNT,
|
|
||||||
)
|
|
||||||
|
|
||||||
chunk_size = TOPIC_CHUNK_WORD_COUNT
|
chunk_size = TOPIC_CHUNK_WORD_COUNT
|
||||||
chunks = []
|
chunks = []
|
||||||
@@ -606,13 +604,11 @@ async def detect_topics(input: PipelineInput, ctx: Context) -> TopicsResult:
|
|||||||
|
|
||||||
results = await topic_chunk_workflow.aio_run_many(bulk_runs)
|
results = await topic_chunk_workflow.aio_run_many(bulk_runs)
|
||||||
|
|
||||||
topic_results = []
|
topic_results = [
|
||||||
for result in results:
|
result.get("detect_chunk_topic", {})
|
||||||
task_result = result.get("detect_chunk_topic", {})
|
for result in results
|
||||||
if task_result:
|
if result.get("detect_chunk_topic")
|
||||||
topic_results.append(task_result)
|
]
|
||||||
|
|
||||||
topic_results.sort(key=lambda t: t.get("timestamp", 0))
|
|
||||||
|
|
||||||
async with fresh_db_connection():
|
async with fresh_db_connection():
|
||||||
transcript = await transcripts_controller.get_by_id(input.transcript_id)
|
transcript = await transcripts_controller.get_by_id(input.transcript_id)
|
||||||
@@ -821,10 +817,9 @@ async def process_subjects(input: PipelineInput, ctx: Context) -> ProcessSubject
|
|||||||
|
|
||||||
results = await subject_workflow.aio_run_many(bulk_runs)
|
results = await subject_workflow.aio_run_many(bulk_runs)
|
||||||
|
|
||||||
subject_summaries = []
|
subject_summaries = [
|
||||||
for result in results:
|
result.get("generate_detailed_summary", {}) for result in results
|
||||||
task_result = result.get("generate_detailed_summary", {})
|
]
|
||||||
subject_summaries.append(task_result)
|
|
||||||
|
|
||||||
ctx.log(f"process_subjects complete: {len(subject_summaries)} summaries")
|
ctx.log(f"process_subjects complete: {len(subject_summaries)} summaries")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user