fix(voice): keep asr partial polling off push path
This commit is contained in:
@@ -291,9 +291,8 @@ class AudioSocketMediaRuntime:
|
||||
return normalized_intent != "unknown"
|
||||
|
||||
def _should_emit_blind_ack(self, actor: MediaActor, pcm_bytes: bytes) -> bool:
|
||||
if len(pcm_bytes) < self._immediate_ack_min_bytes:
|
||||
return False
|
||||
return actor.finalized_caller_turn_count > 0
|
||||
del actor
|
||||
return len(pcm_bytes) >= self._immediate_ack_min_bytes
|
||||
|
||||
@staticmethod
|
||||
def _base_ack_variants(language: str | None, ack_kind: str) -> tuple[str, ...]:
|
||||
@@ -325,8 +324,8 @@ class AudioSocketMediaRuntime:
|
||||
)
|
||||
return (
|
||||
"Угу, сейчас подскажу.",
|
||||
"Мхм, я в контексте.",
|
||||
"Ага, понял.",
|
||||
"Мхм, секунду.",
|
||||
"Ага, сейчас подскажу.",
|
||||
"Хм, секунду.",
|
||||
"Хорошо, сейчас подскажу.",
|
||||
)
|
||||
@@ -485,8 +484,6 @@ class AudioSocketMediaRuntime:
|
||||
stream_id,
|
||||
bytes(batch),
|
||||
)
|
||||
with contextlib.suppress(StreamingASRUnavailable):
|
||||
await self._poll_streaming_partial(actor)
|
||||
except StreamingASRUnavailable as exc:
|
||||
actor.asr_streaming_failed = True
|
||||
actor.asr_streaming_enabled = False
|
||||
|
||||
@@ -952,7 +952,7 @@ def test_media_runtime_voice_v2_emits_ack_for_short_utterance_after_reduced_thre
|
||||
assert speak_events[0][1] < timings["full_finished"]
|
||||
|
||||
|
||||
def test_media_runtime_voice_v2_skips_blind_ack_on_first_turn_without_partial_signal():
|
||||
def test_media_runtime_voice_v2_emits_blind_ack_on_first_turn_without_partial_signal():
|
||||
speak_events: list[tuple[str, float]] = []
|
||||
|
||||
class _FastASRProvider(ASRProvider):
|
||||
@@ -1042,8 +1042,9 @@ def test_media_runtime_voice_v2_skips_blind_ack_on_first_turn_without_partial_si
|
||||
|
||||
asyncio.run(_scenario())
|
||||
|
||||
assert len(speak_events) == 1
|
||||
assert speak_events[0][0] == "Подскажите подробнее, пожалуйста."
|
||||
assert len(speak_events) == 2
|
||||
assert speak_events[0][0] == runtime._ack_text("ru", "generic")
|
||||
assert speak_events[1][0] == "Подскажите подробнее, пожалуйста."
|
||||
|
||||
|
||||
def test_media_runtime_ignores_low_signal_utterance_without_ack_or_turn():
|
||||
|
||||
Reference in New Issue
Block a user