38 lines
874 B
Python
38 lines
874 B
Python
#!/usr/bin/env python3
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
from fastapi import FastAPI
|
|
|
|
PROJECT_ROOT = Path(
|
|
os.environ.get("GENE_FAMILY_ROOT", "/data/gene-family-mas-v2")
|
|
)
|
|
GFANALYSIS_ROOT = Path(
|
|
os.environ.get("GFANALYSIS_ROOT", "/data/wutx/00test/gfAnalysis")
|
|
)
|
|
for root in (PROJECT_ROOT, GFANALYSIS_ROOT):
|
|
value = str(root)
|
|
if value not in sys.path:
|
|
sys.path.insert(0, value)
|
|
|
|
from src.rag.qa_v1_0_0.api import router
|
|
|
|
|
|
app = FastAPI(
|
|
title="Plant Biology QA V1.0.0",
|
|
version="1.0.0",
|
|
description=(
|
|
"Provisional-answer-guided, evidence-verified dual-KB QA. "
|
|
"This service is independent from the legacy combined QA servers."
|
|
),
|
|
)
|
|
app.include_router(router)
|
|
|
|
|
|
@app.get("/health")
|
|
def health():
|
|
return {"status": "ok", "service": "qa_v1_0_0", "version": "1.0.0"}
|