Simplify editor cleanup and keep live ASR metadata
Some checks are pending
ci / test-and-build (push) Waiting to run

Keep the daemon path on the full ASR result so word timings and detected language survive into the editor pipeline instead of falling back to a plain transcript string.

Add PipelineEngine.run_asr_result(), have aman call it when live ASR data is available, and cover the word-aware alignment behavior in the daemon tests.

Collapse the llama cleanup flow to a single JSON-shaped completion while leaving the legacy pass1/pass2 parameters in place as compatibility no-ops.

Validated with PYTHONPATH=src python3 -m unittest tests.test_aiprocess tests.test_aman.
This commit is contained in:
Thales Maciel 2026-03-12 13:24:36 -03:00
parent 8c1f7c1e13
commit fa91f313c4
No known key found for this signature in database
GPG key ID: 33112E6833C34679
5 changed files with 166 additions and 84 deletions

View file

@ -142,6 +142,7 @@ def _process_transcript_pipeline(
stt_lang: str,
pipeline: PipelineEngine,
suppress_ai_errors: bool,
asr_result: AsrResult | None = None,
asr_ms: float = 0.0,
verbose: bool = False,
) -> tuple[str, TranscriptProcessTimings]:
@ -161,7 +162,10 @@ def _process_transcript_pipeline(
total_ms=asr_ms,
)
try:
result = pipeline.run_transcript(processed, language=stt_lang)
if asr_result is not None:
result = pipeline.run_asr_result(asr_result)
else:
result = pipeline.run_transcript(processed, language=stt_lang)
except Exception as exc:
if suppress_ai_errors:
logging.error("editor stage failed: %s", exc)
@ -546,6 +550,7 @@ class Daemon:
stt_lang=stt_lang,
pipeline=self.pipeline,
suppress_ai_errors=False,
asr_result=asr_result,
asr_ms=asr_result.latency_ms,
verbose=self.log_transcript,
)