mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-28 01:32:17 +00:00
fix: avoid rebinding optional mutable inputs
This commit is contained in:
parent
490390a057
commit
09bf95d201
2 changed files with 4 additions and 6 deletions
|
|
@ -5,8 +5,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 | None = None):
|
||||
if headers is None:
|
||||
headers = {}
|
||||
resolved_headers = {} if headers is None else headers
|
||||
self.status_code = status_code
|
||||
self.message = message
|
||||
self.request = httpx.Request(method="POST", url="https://github.com/michaelfeil/infinity")
|
||||
|
|
@ -16,5 +15,5 @@ class InfinityError(BaseLLMException):
|
|||
message=message,
|
||||
request=self.request,
|
||||
response=self.response,
|
||||
headers=headers,
|
||||
headers=resolved_headers,
|
||||
) # Call the base class constructor with the parameters it needs
|
||||
|
|
|
|||
|
|
@ -618,9 +618,8 @@ def check_if_part_exists_in_parts(parts: list[PartType], part: PartType, exclude
|
|||
Check if a part exists in a list of parts
|
||||
Handles both camelCase and snake_case key variations (e.g., function_call vs functionCall)
|
||||
"""
|
||||
if excluded_keys is None:
|
||||
excluded_keys = []
|
||||
keys_to_compare: Final = set(part.keys()) - set(excluded_keys)
|
||||
resolved_excluded_keys = [] if excluded_keys is None else excluded_keys
|
||||
keys_to_compare: Final = set(part.keys()) - set(resolved_excluded_keys)
|
||||
for p in parts:
|
||||
p_keys = set(p.keys())
|
||||
# Check if all keys in part have equivalent values in p
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue