refactor: Add @staticmethod decorator in api/core (#7652)

This commit is contained in:
Shota Totsuka
2024-08-26 20:45:03 +09:00
committed by GitHub
parent 1473083a41
commit 430e100142
4 changed files with 52 additions and 27 deletions

View File

@@ -44,7 +44,8 @@ class ModelInstance:
credentials=self.credentials
)
def _fetch_credentials_from_bundle(self, provider_model_bundle: ProviderModelBundle, model: str) -> dict:
@staticmethod
def _fetch_credentials_from_bundle(provider_model_bundle: ProviderModelBundle, model: str) -> dict:
"""
Fetch credentials from provider model bundle
:param provider_model_bundle: provider model bundle
@@ -63,7 +64,8 @@ class ModelInstance:
return credentials
def _get_load_balancing_manager(self, configuration: ProviderConfiguration,
@staticmethod
def _get_load_balancing_manager(configuration: ProviderConfiguration,
model_type: ModelType,
model: str,
credentials: dict) -> Optional["LBModelManager"]:
@@ -515,8 +517,8 @@ class LBModelManager:
res = cast(bool, res)
return res
@classmethod
def get_config_in_cooldown_and_ttl(cls, tenant_id: str,
@staticmethod
def get_config_in_cooldown_and_ttl(tenant_id: str,
provider: str,
model_type: ModelType,
model: str,