# app.py import os import sys from fastapi import FastAPI sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "components"))) sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "routes"))) sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "routes", "api"))) # --- Your original imports --- from routes.api import ingest # Assuming routes/api/ingest.py exists and has a 'router' from routes.api import query # Assuming routes/api/query.py exists and has a 'router' from routes.api import headlines # Assuming routes/api/headlines.py exists and has a 'router' from routes.api import wa_headlines # You included Settings in your original, so I'll put it back. # NOTE: Settings.llm = None can cause issues if LlamaIndex operations # elsewhere expect a global LLM to be configured via Settings. from llama_index.core.settings import Settings Settings.llm = None app = FastAPI() @app.get("/") def greet(): return {"welcome": "nuse ai"} # --- Your original router inclusions --- app.include_router(ingest.router) app.include_router(query.router) app.include_router(headlines.router) app.include_router(wa_headlines.router)