fixed some linting issues
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user