mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
Fix mutable default argument in InfinityError.__init__
Use None as default and initialize empty dict inside the function to prevent mutable default argument anti-pattern.
This commit is contained in:
parent
31ca4ddf32
commit
59ea2a5792
1 changed files with 3 additions and 1 deletions
|
|
@ -4,7 +4,9 @@ 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):
|
||||
if headers is None:
|
||||
headers = {}
|
||||
self.status_code = status_code
|
||||
self.message = message
|
||||
self.request = httpx.Request(method="POST", url="https://github.com/michaelfeil/infinity")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue