Feature Request
Summary
Currently VisaIQ is only accessible via the Streamlit UI. Adding a FastAPI layer would allow:
- Mobile app integration (Flutter client)
- Third-party integrations
- Programmatic batch predictions
Proposed Implementation
# api.py
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from predict import predict_with_confidence
app = FastAPI(title="VisaIQ API", version="1.0.0")
class PredictionRequest(BaseModel):
country: str
visa_type: str
application_date: str # YYYY-MM-DD
class PredictionResponse(BaseModel):
days: float
lower: float
upper: float
confidence: float
confidence_label: str
@app.post("/predict", response_model=PredictionResponse)
def predict(req: PredictionRequest):
result, error = predict_with_confidence(req.dict())
if error:
raise HTTPException(status_code=422, detail=error)
return result
@app.get("/health")
def health():
return {"status": "ok", "model_loaded": MODEL_LOADED}
Deploy alongside Streamlit:
uvicorn api:app --port 8001 &
streamlit run app.py --port 8501
Use Cases
- Flutter mobile app for VisaIQ
- Agency dashboard integrations
- Automated batch processing scripts
enhancement api fastapi integration
Feature Request
Summary
Currently VisaIQ is only accessible via the Streamlit UI. Adding a FastAPI layer would allow:
Proposed Implementation
Deploy alongside Streamlit:
uvicorn api:app --port 8001 & streamlit run app.py --port 8501Use Cases
enhancementapifastapiintegration