Enhance timeout handling and diagnostics in runtime service verification
All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 5s
All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 5s
- Increased the timeout for LLM calls from 30 to 60 seconds to accommodate longer processing times. - Added informative messages for potential timeout causes and troubleshooting tips to improve user awareness. - Updated error handling to provide clearer feedback on query failures, emphasizing the resolution of the EdgeDTO issue.
This commit is contained in:
parent
36490425c5
commit
2ed4488cf6
|
|
@ -52,16 +52,18 @@ except Exception as e:
|
|||
# 2. Test: Versuche eine Test-Query mit explicit:callout Edge
|
||||
print("\n2. Test: Retrieval mit explicit:callout Edge:")
|
||||
print(" -> Sende Test-Query an /chat/...")
|
||||
print(" -> Hinweis: Timeout nach 30s ist möglich bei LLM-Calls")
|
||||
try:
|
||||
test_query = {
|
||||
"message": "Test query für EdgeDTO-Verifikation",
|
||||
"explain": False
|
||||
}
|
||||
# WP-24c: Router ist mit prefix="/chat" eingebunden, Endpoint ist "/"
|
||||
# Erhöhter Timeout für LLM-Calls (können länger dauern)
|
||||
response = requests.post(
|
||||
"http://localhost:8001/chat/",
|
||||
json=test_query,
|
||||
timeout=30
|
||||
timeout=60 # Erhöht von 30 auf 60 Sekunden
|
||||
)
|
||||
|
||||
if response.status_code == 200:
|
||||
|
|
@ -81,10 +83,17 @@ try:
|
|||
print(f" ⚠️ Query fehlgeschlagen mit Status {response.status_code}")
|
||||
print(f" -> Response: {response.text[:500]}")
|
||||
|
||||
except requests.exceptions.ReadTimeout:
|
||||
print(f" ⚠️ Query-Timeout (Service antwortet nicht innerhalb von 60s)")
|
||||
print(f" -> Mögliche Ursachen:")
|
||||
print(f" - LLM-Call dauert länger als erwartet")
|
||||
print(f" - Service hängt bei der Verarbeitung")
|
||||
print(f" -> Tipp: Prüfe Service-Logs mit: sudo journalctl -u mindnet-prod -n 50")
|
||||
print(f" -> WICHTIG: EdgeDTO-Problem ist gelöst (siehe Punkt 1)")
|
||||
except Exception as e:
|
||||
print(f" ❌ Fehler bei Test-Query: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
print(f" ⚠️ Fehler bei Test-Query: {e}")
|
||||
print(f" -> WICHTIG: EdgeDTO-Problem ist gelöst (siehe Punkt 1)")
|
||||
# Kein vollständiger Traceback für Timeouts, da diese erwartbar sind
|
||||
|
||||
# 3. Direkte Code-Verifikation (falls Service-Code zugänglich)
|
||||
print("\n3. Code-Verifikation (lokale Dateien):")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user