Merge pull request #2757 from pipecat-ai/hush/retryTimeout
Fix AWS Bedrock timeout exception handling
This commit is contained in:
@@ -27,6 +27,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
|
- Fixed an issue in `AWSBedrockLLMService` where timeout exceptions weren't
|
||||||
|
being detected.
|
||||||
|
|
||||||
- Fixed a `PipelineTask` issue that could prevent the application to exit if
|
- Fixed a `PipelineTask` issue that could prevent the application to exit if
|
||||||
`task.cancel()` was called when the task was already finished.
|
`task.cancel()` was called when the task was already finished.
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ from pipecat.utils.tracing.service_decorators import traced_llm
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
import aioboto3
|
import aioboto3
|
||||||
import httpx
|
|
||||||
from botocore.config import Config
|
from botocore.config import Config
|
||||||
from botocore.exceptions import ReadTimeoutError
|
from botocore.exceptions import ReadTimeoutError
|
||||||
except ModuleNotFoundError as e:
|
except ModuleNotFoundError as e:
|
||||||
@@ -1117,7 +1116,7 @@ class AWSBedrockLLMService(LLMService):
|
|||||||
# also get cancelled.
|
# also get cancelled.
|
||||||
use_completion_tokens_estimate = True
|
use_completion_tokens_estimate = True
|
||||||
raise
|
raise
|
||||||
except httpx.TimeoutException:
|
except (ReadTimeoutError, asyncio.TimeoutError):
|
||||||
await self._call_event_handler("on_completion_timeout")
|
await self._call_event_handler("on_completion_timeout")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(f"{self} exception: {e}")
|
logger.exception(f"{self} exception: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user