From 65d0be85fc5b232e87eb8d8cd4ae9726bdfc7014 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 11 May 2024 19:55:38 -0700 Subject: [PATCH] fix(bedrock_httpx.py): compatibility fix --- litellm/llms/bedrock_httpx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/bedrock_httpx.py b/litellm/llms/bedrock_httpx.py index 2d24af8773..1ff3767bdc 100644 --- a/litellm/llms/bedrock_httpx.py +++ b/litellm/llms/bedrock_httpx.py @@ -270,7 +270,7 @@ class BedrockLLM(BaseLLM): def process_response( self, model: str, - response: requests.Response | httpx.Response, + response: Union[requests.Response, httpx.Response], model_response: ModelResponse, stream: bool, logging_obj: Logging, @@ -720,7 +720,7 @@ class AWSEventStreamDecoder: ) yield streaming_chunk - def _parse_message_from_event(self, event) -> str | None: + def _parse_message_from_event(self, event) -> Optional[str]: response_dict = event.to_response_dict() parsed_response = self.parser.parse(response_dict, get_response_stream_shape()) if response_dict["status_code"] != 200: