Peter Mutwiri commited on
Commit
c996b34
Β·
1 Parent(s): 644db45

corrected hf spaces

Browse files
Files changed (2) hide show
  1. app/deps.py +2 -1
  2. 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
- APP_URL = get_secret("SPACE_HOST", required=True)
 
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.services.vector_service import VectorService
5
- from app.services.llm_service import LLMService # Your existing LLM file
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"])