diff --git a/apps/api/src/api/v1/rag.py b/apps/api/src/api/v1/rag.py index a7d2968a..8fb20982 100644 --- a/apps/api/src/api/v1/rag.py +++ b/apps/api/src/api/v1/rag.py @@ -72,16 +72,16 @@ async def rag_debug() -> dict: "files": [f.name for f in d.glob("*.md")][:3] if d.exists() else [], } - ollama_ok = False + ollama_ok: bool | str = False try: - async with httpx.AsyncClient(timeout=5.0) as c: + async with httpx.AsyncClient(timeout=10.0) as c: r = await c.post( "http://192.168.0.188:11434/api/embeddings", json={"model": "nomic-embed-text", "prompt": "test"}, ) - ollama_ok = r.status_code == 200 + ollama_ok = r.status_code == 200 if r.status_code == 200 else f"http_{r.status_code}" except Exception as e: - ollama_ok = str(e) + ollama_ok = f"error: {type(e).__name__}: {e}" return {"cwd": os.getcwd(), "paths": paths_check, "ollama_188_embed": ollama_ok}