mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
fix: use None default for InfinityError headers to avoid mutable default argument
Using a mutable default argument = {} causes all InfinityError instances raised
without explicit headers to share the same dict object. This matches the convention
already used by BaseLLMException, OpenAIError, and AnthropicError.
Fixes #38909
This commit is contained in:
parent
4ba8517134
commit
e3cf4d8f00
1 changed files with 2 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ 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")
|
||||
|
|
@ -15,4 +15,4 @@ class InfinityError(BaseLLMException):
|
|||
request=self.request,
|
||||
response=self.response,
|
||||
headers=headers,
|
||||
) # Call the base class constructor with the parameters it needs
|
||||
) # Call the base class constructor with the parameters it needs
|
||||
Loading…
Add table
Reference in a new issue