mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-12 03:48:56 +00:00
style(router): annotate the facade's special methods and re-anchor a moved suppression
The facade's __init__/__getattr__/__setattr__/__delattr__ added four ANN204 violations, and formatting python_router.py moved a rebind-ok comment off the line it suppresses (LIT013). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Aw1xktpUnix5tWhvSzey8t
This commit is contained in:
parent
8f1821054f
commit
e9f89175aa
2 changed files with 6 additions and 6 deletions
|
|
@ -57,20 +57,20 @@ class Router(_RouterSurface):
|
|||
|
||||
if not TYPE_CHECKING:
|
||||
|
||||
def __init__(self, *args, **kwargs): # kwargs-ok: forwards PythonRouter.__init__'s signature
|
||||
def __init__(self, *args, **kwargs) -> None: # kwargs-ok: forwards PythonRouter.__init__'s signature
|
||||
object.__setattr__(self, "backend", select_backend(args, kwargs))
|
||||
|
||||
__init__.__signature__ = inspect.signature(PythonRouter.__init__)
|
||||
|
||||
def __getattr__(self, name):
|
||||
def __getattr__(self, name: str) -> object:
|
||||
if name == "backend":
|
||||
raise AttributeError(name)
|
||||
return getattr(self.backend, name)
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
def __setattr__(self, name: str, value: object) -> None:
|
||||
setattr(self.backend, name, value)
|
||||
|
||||
def __delattr__(self, name):
|
||||
def __delattr__(self, name: str) -> None:
|
||||
delattr(self.backend, name)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3559,8 +3559,8 @@ class PythonRouter:
|
|||
self._ageneric_api_call_with_fallbacks_responses_attempt
|
||||
)
|
||||
if e.generated_content and not e.is_pre_first_chunk:
|
||||
initial_kwargs["input"] = (
|
||||
PythonRouter._build_responses_continuation_input( # rebind-ok: fallback hop input
|
||||
initial_kwargs["input"] = ( # rebind-ok: fallback hop input
|
||||
PythonRouter._build_responses_continuation_input(
|
||||
initial_kwargs.get("input"),
|
||||
e.generated_content,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue