Files
aethas-free/modules/router - Copie.py
T
xavier 9fdb2bd73e
Build and Push Docker Image / build-and-push (push) Successful in 35s
Amélioration contraste mobile, traçabilité des IA et filtrage catalogue
2026-08-23 15:09:57 +02:00

15 lines
426 B
Python

import json
import re
def nettoyer_decision_router(raw_text):
try:
clean = re.sub(r'```(?:json)?\s*', '', raw_text)
clean = clean.replace('```', '').strip()
start = clean.find('{')
end = clean.rfind('}') + 1
if start != -1 and end != 0:
return json.loads(clean[start:end])
except Exception:
pass
return {"intention": "Analyse", "fournisseur": "gemini"}