diff --git a/litellm/exceptions.py b/litellm/exceptions.py index 6570a4bc1b..d96992d57f 100644 --- a/litellm/exceptions.py +++ b/litellm/exceptions.py @@ -46,11 +46,12 @@ class BadRequestError(BadRequestError): # type: ignore ) # Call the base class constructor with the parameters it needs class Timeout(APITimeoutError): # type: ignore - def __init__(self, message, model, llm_provider, request: httpx.Request): + def __init__(self, message, model, llm_provider): self.status_code = 408 self.message = message self.model = model self.llm_provider = llm_provider + request = httpx.Request(method="POST", url="https://api.openai.com/v1") super().__init__( request=request ) # Call the base class constructor with the parameters it needs diff --git a/litellm/tests/test_batch_completions.py b/litellm/tests/test_batch_completions.py index 74f33a67d9..4521f655a4 100644 --- a/litellm/tests/test_batch_completions.py +++ b/litellm/tests/test_batch_completions.py @@ -7,7 +7,7 @@ import pytest sys.path.insert( 0, os.path.abspath("../..") ) # Adds the parent directory to the system path -from openai import Timeout +from openai import APITimeoutError as Timeout import litellm from litellm import batch_completion, batch_completion_models, completion, batch_completion_models_all_responses # litellm.set_verbose=True @@ -31,7 +31,7 @@ def test_batch_completions(): pass except Exception as e: pytest.fail(f"An error occurred: {e}") -# test_batch_completions() +test_batch_completions() def test_batch_completions_models(): try: diff --git a/litellm/timeout.py b/litellm/timeout.py index 19947f3f31..e4c14eed59 100644 --- a/litellm/timeout.py +++ b/litellm/timeout.py @@ -17,7 +17,7 @@ from concurrent import futures from inspect import iscoroutinefunction from functools import wraps from threading import Thread -from openai import Timeout +from litellm.exceptions import Timeout def timeout(timeout_duration: float = 0.0, exception_to_raise=Timeout):