Initial MobilityOps build pack (docs, contracts, scaffold)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
from functools import lru_cache
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
||||
|
||||
mobilityops_env: str = "development"
|
||||
mobilityops_demo_mode: bool = True
|
||||
database_url: str = "postgresql+psycopg://mobilityops:mobilityops@db:5432/mobilityops"
|
||||
knowledge_provider: str = "demo"
|
||||
ragcore_base_url: str = "http://ragcore-api:8000"
|
||||
ragcore_tenant: str = "northstar-mobility-demo"
|
||||
ragcore_workspace: str = "mobilityops"
|
||||
ragcore_collection: str = "internal-procedures"
|
||||
n8n_webhook_url: str = "http://n8n:5678/webhook/mobilityops-return"
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_settings() -> Settings:
|
||||
return Settings()
|
||||
@@ -0,0 +1,22 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
from app.core.config import get_settings
|
||||
|
||||
settings = get_settings()
|
||||
app = FastAPI(title="MobilityOps API", version="0.0.1")
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
def health() -> dict[str, str]:
|
||||
return {"status": "ok", "service": "mobilityops-api"}
|
||||
|
||||
|
||||
@app.get("/api/v1/system/status")
|
||||
def system_status() -> dict[str, object]:
|
||||
return {
|
||||
"service": "mobilityops-api",
|
||||
"environment": settings.mobilityops_env,
|
||||
"demo_mode": settings.mobilityops_demo_mode,
|
||||
"knowledge_provider": settings.knowledge_provider,
|
||||
"scaffold": True,
|
||||
}
|
||||
Reference in New Issue
Block a user