fixed some linting issues

This commit is contained in:
Saifeddine ALOUI
2025-01-17 02:34:29 +01:00
parent 5bb9d9f0c0
commit 6813742a86

View File

@@ -26,6 +26,8 @@ from contextlib import asynccontextmanager
from starlette.status import HTTP_403_FORBIDDEN
import pipmaster as pm
from dotenv import load_dotenv
def get_default_host(binding_type: str) -> str:
default_hosts = {
@@ -39,9 +41,6 @@ def get_default_host(binding_type: str) -> str:
) # fallback to ollama if unknown
from dotenv import load_dotenv
def get_env_value(env_key: str, default: Any, value_type: type = str) -> Any:
"""
Get value from environment variable with type conversion
@@ -58,7 +57,7 @@ def get_env_value(env_key: str, default: Any, value_type: type = str) -> Any:
if value is None:
return default
if value_type == bool:
if isinstance(value_type, bool):
return value.lower() in ("true", "1", "yes")
try:
return value_type(value)