Peter Mutwiri commited on
Commit Β·
c996b34
1
Parent(s): 644db45
corrected hf spaces
Browse files- app/deps.py +2 -1
- app/routers/ai_query.py +2 -2
app/deps.py
CHANGED
|
@@ -44,7 +44,8 @@ HF_API_TOKEN = get_secret("HF_API_TOKEN", required=False)
|
|
| 44 |
# QStash Token (optional, for advanced queue features)
|
| 45 |
QSTASH_TOKEN = get_secret("QSTASH_TOKEN", required=False)
|
| 46 |
# Application URL (where this HF Space is hosted)
|
| 47 |
-
|
|
|
|
| 48 |
|
| 49 |
# ββ Singleton Database Connections ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 50 |
_org_db_connections = {}
|
|
|
|
| 44 |
# QStash Token (optional, for advanced queue features)
|
| 45 |
QSTASH_TOKEN = get_secret("QSTASH_TOKEN", required=False)
|
| 46 |
# Application URL (where this HF Space is hosted)
|
| 47 |
+
# Application URL (auto-injected by HF Spaces, fallback for local dev)
|
| 48 |
+
APP_URL = os.getenv("SPACE_HOST", "http://localhost:8000").rstrip("/")
|
| 49 |
|
| 50 |
# ββ Singleton Database Connections ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 51 |
_org_db_connections = {}
|
app/routers/ai_query.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
# app/routers/ai_query.py
|
| 2 |
from fastapi import APIRouter, Depends, HTTPException
|
| 3 |
from typing import Dict, Any
|
| 4 |
-
from app.
|
| 5 |
-
from app.
|
| 6 |
from app.deps import get_current_user
|
| 7 |
|
| 8 |
router = APIRouter(prefix="/api/v1/ai", tags=["ai"])
|
|
|
|
| 1 |
# app/routers/ai_query.py
|
| 2 |
from fastapi import APIRouter, Depends, HTTPException
|
| 3 |
from typing import Dict, Any
|
| 4 |
+
from app.service.vector_service import VectorService
|
| 5 |
+
from app.service.llm_service import LocalLLMService # Your existing LLM file
|
| 6 |
from app.deps import get_current_user
|
| 7 |
|
| 8 |
router = APIRouter(prefix="/api/v1/ai", tags=["ai"])
|