From 7b8440191e8597ebdf1a7bb520c1fed40c66df13 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Wed, 6 May 2026 14:33:58 +0200 Subject: [PATCH] fix: Better error logging + increase LLM timeout to 120s for RAG check Co-Authored-By: Claude Opus 4.6 (1M context) --- .../compliance/services/rag_document_checker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend-compliance/compliance/services/rag_document_checker.py b/backend-compliance/compliance/services/rag_document_checker.py index b01a45a..f51bc25 100644 --- a/backend-compliance/compliance/services/rag_document_checker.py +++ b/backend-compliance/compliance/services/rag_document_checker.py @@ -194,11 +194,12 @@ async def _verify_control_with_llm( ) try: - async with httpx.AsyncClient(timeout=60.0) as client: + async with httpx.AsyncClient(timeout=120.0) as client: resp = await client.post(f"{OLLAMA_URL}/api/generate", json={ "model": OLLAMA_MODEL, "prompt": prompt, "stream": False, + "options": {"num_predict": 200}, # Limit response length }) if resp.status_code != 200: @@ -229,5 +230,5 @@ async def _verify_control_with_llm( } except Exception as e: - logger.warning("LLM verification failed: %s", e) + logger.warning("LLM verification failed: %s %s", type(e).__name__, e) return None