AWSNovaSonicLLMService: fix error with watchdog_coroutine()
This commit is contained in:
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
time, you will need to wrap it with `watchdog_coroutine()` so the watchdog
|
time, you will need to wrap it with `watchdog_coroutine()` so the watchdog
|
||||||
timers are reset regularly.
|
timers are reset regularly.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed a `AWSNovaSonicLLMService` issue introduced in 0.0.72.
|
||||||
|
|
||||||
## [0.0.73] - 2025-06-26
|
## [0.0.73] - 2025-06-26
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ from pipecat.services.aws_nova_sonic.context import (
|
|||||||
)
|
)
|
||||||
from pipecat.services.aws_nova_sonic.frames import AWSNovaSonicFunctionCallResultFrame
|
from pipecat.services.aws_nova_sonic.frames import AWSNovaSonicFunctionCallResultFrame
|
||||||
from pipecat.services.llm_service import LLMService
|
from pipecat.services.llm_service import LLMService
|
||||||
|
from pipecat.utils.asyncio.watchdog_coroutine import watchdog_coroutine
|
||||||
from pipecat.utils.time import time_now_iso8601
|
from pipecat.utils.time import time_now_iso8601
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -776,9 +777,7 @@ class AWSNovaSonicLLMService(LLMService):
|
|||||||
try:
|
try:
|
||||||
while self._stream and not self._disconnecting:
|
while self._stream and not self._disconnecting:
|
||||||
output = await self._stream.await_output()
|
output = await self._stream.await_output()
|
||||||
result = await asyncio.wait_for(output[1].receive(), timeout=1.0)
|
result = await watchdog_coroutine(output[1].receive(), manager=self.task_manager)
|
||||||
|
|
||||||
self.reset_watchdog()
|
|
||||||
|
|
||||||
if result.value and result.value.bytes_:
|
if result.value and result.value.bytes_:
|
||||||
response_data = result.value.bytes_.decode("utf-8")
|
response_data = result.value.bytes_.decode("utf-8")
|
||||||
@@ -807,8 +806,6 @@ class AWSNovaSonicLLMService(LLMService):
|
|||||||
elif "completionEnd" in event_json:
|
elif "completionEnd" in event_json:
|
||||||
# Handle the LLM completion ending
|
# Handle the LLM completion ending
|
||||||
await self._handle_completion_end_event(event_json)
|
await self._handle_completion_end_event(event_json)
|
||||||
except asyncio.TimeoutError:
|
|
||||||
self.reset_watchdog()
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"{self} error processing responses: {e}")
|
logger.error(f"{self} error processing responses: {e}")
|
||||||
if self._wants_connection:
|
if self._wants_connection:
|
||||||
|
|||||||
Reference in New Issue
Block a user