mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
refactor: add black formatting
This commit is contained in:
parent
b87d630b0a
commit
4905929de3
156 changed files with 19723 additions and 10869 deletions
|
@ -1,30 +1,41 @@
|
|||
from typing import List, Dict
|
||||
import types
|
||||
|
||||
class OpenrouterConfig():
|
||||
|
||||
class OpenrouterConfig:
|
||||
"""
|
||||
Reference: https://openrouter.ai/docs#format
|
||||
|
||||
"""
|
||||
|
||||
# OpenRouter-only parameters
|
||||
extra_body: Dict[str, List[str]] = {
|
||||
'transforms': [] # default transforms to []
|
||||
}
|
||||
extra_body: Dict[str, List[str]] = {"transforms": []} # default transforms to []
|
||||
|
||||
|
||||
def __init__(self,
|
||||
transforms: List[str] = [],
|
||||
models: List[str] = [],
|
||||
route: str = '',
|
||||
) -> None:
|
||||
def __init__(
|
||||
self,
|
||||
transforms: List[str] = [],
|
||||
models: List[str] = [],
|
||||
route: str = "",
|
||||
) -> None:
|
||||
locals_ = locals()
|
||||
for key, value in locals_.items():
|
||||
if key != 'self' and value is not None:
|
||||
if key != "self" and value is not None:
|
||||
setattr(self.__class__, key, value)
|
||||
|
||||
@classmethod
|
||||
def get_config(cls):
|
||||
return {k: v for k, v in cls.__dict__.items()
|
||||
if not k.startswith('__')
|
||||
and not isinstance(v, (types.FunctionType, types.BuiltinFunctionType, classmethod, staticmethod))
|
||||
and v is not None}
|
||||
return {
|
||||
k: v
|
||||
for k, v in cls.__dict__.items()
|
||||
if not k.startswith("__")
|
||||
and not isinstance(
|
||||
v,
|
||||
(
|
||||
types.FunctionType,
|
||||
types.BuiltinFunctionType,
|
||||
classmethod,
|
||||
staticmethod,
|
||||
),
|
||||
)
|
||||
and v is not None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue