mirror of
https://github.com/ghndrx/starlane-router.git
synced 2026-02-10 06:45:01 +00:00
feat: initial commit for starlane-router (FastAPI + Gradient)
This commit is contained in:
24
app/config.py
Normal file
24
app/config.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
from typing import List
|
||||
|
||||
|
||||
def _get_env(name: str, default: str = "") -> str:
|
||||
return os.getenv(name, default).strip()
|
||||
|
||||
|
||||
def get_gradient_endpoint_url() -> str:
|
||||
return _get_env("GRADIENT_ENDPOINT_URL")
|
||||
|
||||
|
||||
def get_gradient_api_key() -> str:
|
||||
return _get_env("GRADIENT_API_KEY")
|
||||
|
||||
|
||||
def get_gradient_auth_scheme() -> str:
|
||||
# 'authorization_bearer' or 'x_api_key'
|
||||
return _get_env("GRADIENT_AUTH_SCHEME", "authorization_bearer").lower()
|
||||
|
||||
|
||||
def get_route_keywords() -> List[str]:
|
||||
raw = _get_env("ROUTE_KEYWORDS", "ai,model,ml,gpt,router,gradient")
|
||||
return [kw.strip().lower() for kw in raw.split(",") if kw.strip()]
|
||||
Reference in New Issue
Block a user