mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 34s
* fix(utils.py): initial commit fixing custom cost tracking refactors out provider specific model info from `get_model_info` - this was causing custom costs to be registered incorrectly * fix(utils.py): cleanup `_supports_factory` to check provider info, if model info is None some providers support features like vision across all models * fix(utils.py): refactor to use _supports_factory * test: update testing * fix: fix linting errors * test: fix testing
31 lines
883 B
Python
31 lines
883 B
Python
from typing import List, Optional
|
|
|
|
from litellm.secret_managers.main import get_secret_str
|
|
|
|
from ..base_llm.base_utils import BaseLLMModelInfo
|
|
from ..base_llm.chat.transformation import BaseLLMException
|
|
|
|
|
|
class TopazException(BaseLLMException):
|
|
pass
|
|
|
|
|
|
class TopazModelInfo(BaseLLMModelInfo):
|
|
def get_models(self) -> List[str]:
|
|
return [
|
|
"topaz/Standard V2",
|
|
"topaz/Low Resolution V2",
|
|
"topaz/CGI",
|
|
"topaz/High Resolution V2",
|
|
"topaz/Text Refine",
|
|
]
|
|
|
|
@staticmethod
|
|
def get_api_key(api_key: Optional[str] = None) -> Optional[str]:
|
|
return api_key or get_secret_str("TOPAZ_API_KEY")
|
|
|
|
@staticmethod
|
|
def get_api_base(api_base: Optional[str] = None) -> Optional[str]:
|
|
return (
|
|
api_base or get_secret_str("TOPAZ_API_BASE") or "https://api.topazlabs.com"
|
|
)
|