File size: 1,260 Bytes
af23d2f
 
6d24925
3566f32
 
af23d2f
 
3566f32
af23d2f
 
3566f32
 
 
 
 
 
af23d2f
3566f32
5b8169f
 
6d24925
3566f32
5b8169f
6d24925
 
 
5e1e9ae
6d24925
3566f32
5b8169f
 
 
3566f32
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
import sys
from fastapi import FastAPI

# Add paths to sys.path to allow relative imports
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")))

# Import your API routes
from routes.api import ingest  # routes/api/ingest.py
from routes.api import query   # routes/api/query.py
from routes.api import headlines  # routes/api/headlines.py
from routes.api import wa_headlines  # routes/api/wa_headlines.py
from routes.api import whatsapp_webhook as whatsapp_webhook_router_module

# Optional: Global Settings (LlamaIndex)
from llama_index.core.settings import Settings
Settings.llm = None

# Create FastAPI app
app = FastAPI()

@app.get("/")
def greet():
    return {"welcome": "nuse ai"}

# Include your route modules
app.include_router(ingest.router)
app.include_router(query.router)
app.include_router(headlines.router)
app.include_router(wa_headlines.router)
app.include_router(whatsapp_webhook_router_module.router, prefix="/api/whatsapp", tags=["WhatsApp Webhook"])