File size: 1,189 Bytes
20b15f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
36
37
38
39
40
import logging

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

from app.modules.intent.router import router as intent_router
from app.modules.search.router import router as search_router

# Root config for anything logged outside a specific run (server
# startup/shutdown, module-level fallback loggers used when a provider
# function is called standalone rather than from a graph node). Per-request
# logs go through app.core.logging_config.get_node_logger instead, which
# writes its own logs/{run_id}.log and does not propagate up to this root
# handler — so this does not duplicate those.
logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s | %(levelname)-7s | %(name)s | %(message)s",
    datefmt="%Y-%m-%d %H:%M:%S",
)

app = FastAPI(title="Research Assistant Pipeline API")

# Dev-friendly CORS. Lock this down to your actual frontend origin(s) before
# deploying anywhere real.
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_methods=["*"],
    allow_headers=["*"],
)


@app.get("/health")
def health():
    return {"status": "ok"}


app.include_router(intent_router)
app.include_router(search_router)