maj auto 2

This commit is contained in:
xavier committed 2026-08-16 23:26:07 +02:00
1 parent d47bd67391
commit f91b5ae215
11 files changed
+647 -477

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
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"}