mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-28 01:32:17 +00:00
Merge f7a76bdc64 into e26a6450c8
This commit is contained in:
commit
35fa09f4fb
2 changed files with 15 additions and 1 deletions
|
|
@ -4,7 +4,12 @@ from litellm.llms.base_llm.chat.transformation import BaseLLMException
|
|||
|
||||
|
||||
class InfinityError(BaseLLMException):
|
||||
def __init__(self, status_code: int, message: str, headers: dict | httpx.Headers = {}):
|
||||
def __init__(
|
||||
self,
|
||||
status_code: int,
|
||||
message: str,
|
||||
headers: dict | httpx.Headers | None = None,
|
||||
):
|
||||
self.status_code = status_code
|
||||
self.message = message
|
||||
self.request = httpx.Request(method="POST", url="https://github.com/michaelfeil/infinity")
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ from unittest.mock import AsyncMock
|
|||
|
||||
|
||||
import litellm
|
||||
from litellm.llms.infinity.common_utils import InfinityError
|
||||
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
|
|
@ -17,6 +18,14 @@ from litellm.llms.custom_httpx.http_handler import HTTPHandler, AsyncHTTPHandler
|
|||
from litellm.types.utils import EmbeddingResponse, Usage
|
||||
|
||||
|
||||
def test_infinity_error_default_headers_are_not_shared() -> None:
|
||||
first_error = InfinityError(status_code=500, message="first")
|
||||
second_error = InfinityError(status_code=500, message="second")
|
||||
|
||||
assert first_error.headers is None
|
||||
assert second_error.headers is None
|
||||
|
||||
|
||||
@pytest.mark.asyncio()
|
||||
async def test_infinity_rerank():
|
||||
mock_response = AsyncMock()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue