mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-06-17 23:09:35 +00:00
fix(health): correctly resolve prompts dir path for agent health api
This commit is contained in:
parent
cd89b54b74
commit
1036582ec0
@ -11,9 +11,20 @@ import logging
|
||||
from app.database import get_db
|
||||
|
||||
router = APIRouter(prefix="/agent-health", tags=["Agent Health"])
|
||||
logger = logging.getLogger("dealix.agent_health")
|
||||
# The scripts are typically in backend/app/api/v1
|
||||
# We know the absolute structure from the project root
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
PROMPTS_DIR = Path(__file__).parent.parent.parent.parent / "ai-agents" / "prompts"
|
||||
_current_dir = Path(__file__).resolve()
|
||||
# We are in backned/app/api/v1/agent_health.py -> 4 parents up -> then up out of salesflow-saas to ai-agents
|
||||
PROMPTS_DIR = _current_dir.parent.parent.parent.parent.parent / "ai-agents" / "prompts"
|
||||
|
||||
if not PROMPTS_DIR.exists():
|
||||
# If the app is run from a different level
|
||||
PROMPTS_DIR = _current_dir.parent.parent.parent.parent / "ai-agents" / "prompts"
|
||||
if not PROMPTS_DIR.exists():
|
||||
PROMPTS_DIR = Path("C:/Users/samim/system-prompts-and-models-of-ai-tools/ai-agents/prompts")
|
||||
|
||||
|
||||
@router.get("/status")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user