From 15089dc0fe57ca98627b7409345eb9c21c2bcc72 Mon Sep 17 00:00:00 2001 From: 11linear11 <11linearlin11@gmail.com> Date: Mon, 31 Aug 2026 06:56:30 -0400 Subject: [PATCH] feat(api): add api rout chat --- app/core/config.py | 1 + app/main.py | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/app/core/config.py b/app/core/config.py index 7d5826a..b04c122 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -6,6 +6,7 @@ class Settings(BaseSettings): app_name: str = "Technical Documentation Assistant" app_version: str = "1.0.0" app_environment: str = "development" # development,production + app_description: str = "just a assistant" # LLM Config api_key: str diff --git a/app/main.py b/app/main.py index e69de29..b66612d 100644 --- a/app/main.py +++ b/app/main.py @@ -0,0 +1,25 @@ +# pyrefly: ignore [missing-import] +from fastapi import FastAPI +from app.api.v1.chat import router as chat_router +from app.core.config import settings +from fastapi.middleware.cors import CORSMiddleware + +app = FastAPI( + title=settings.app_name, + version=settings.app_version, + description=settings.app_description, +) + +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) + +app.include_router(chat_router, prefix="/api/v1") + +@app.get("/api/v1/health", tags=["Health"]) +async def health_check(): + return {"status": "healthy"} \ No newline at end of file