mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix(token_kiosk): use public method for provider info to pass reportPrivateUsage lint
Signed-off-by: hgaib <hung.cheng@gaib.ai>
This commit is contained in:
parent
dab227866b
commit
6fc0e640cc
3 changed files with 8 additions and 3 deletions
|
|
@ -830,7 +830,7 @@ def _get_openai_compatible_provider_info(
|
|||
(
|
||||
api_base,
|
||||
dynamic_api_key,
|
||||
) = litellm.TokenKioskConfig()._get_openai_compatible_provider_info(api_base, api_key)
|
||||
) = litellm.TokenKioskConfig().get_openai_compatible_provider_info(api_base, api_key)
|
||||
elif custom_llm_provider == "wandb":
|
||||
api_base = api_base or get_secret("WANDB_API_BASE") or "https://api.inference.wandb.ai/v1"
|
||||
dynamic_api_key = api_key or get_secret_str("WANDB_API_KEY")
|
||||
|
|
|
|||
|
|
@ -9,13 +9,18 @@ from litellm.secret_managers.main import get_secret_str
|
|||
|
||||
|
||||
class TokenKioskConfig(OpenAIGPTConfig):
|
||||
def _get_openai_compatible_provider_info(
|
||||
def get_openai_compatible_provider_info(
|
||||
self, api_base: str | None, api_key: str | None
|
||||
) -> tuple[str | None, str | None]:
|
||||
final_api_base: Final = api_base or get_secret_str("TOKEN_KIOSK_API_BASE") or "https://agent-router.gaib.ai/v1"
|
||||
dynamic_api_key: Final = api_key or get_secret_str("TOKEN_KIOSK_API_KEY")
|
||||
return final_api_base, dynamic_api_key
|
||||
|
||||
def _get_openai_compatible_provider_info(
|
||||
self, api_base: str | None, api_key: str | None
|
||||
) -> tuple[str | None, str | None]:
|
||||
return self.get_openai_compatible_provider_info(api_base, api_key)
|
||||
|
||||
def get_complete_url(
|
||||
self,
|
||||
api_base: str | None,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ def test_token_kiosk_llm_provider_enum():
|
|||
|
||||
def test_token_kiosk_get_openai_compatible_provider_info():
|
||||
config = TokenKioskConfig()
|
||||
api_base, api_key = config._get_openai_compatible_provider_info(
|
||||
api_base, api_key = config.get_openai_compatible_provider_info(
|
||||
api_base=None, api_key="test-key"
|
||||
)
|
||||
assert api_base == "https://agent-router.gaib.ai/v1"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue