Public Access
maj auto 2
This commit is contained in:
1 parent
d47bd67391
commit
f91b5ae215
11 files changed
+647
-477
No files matched your search
@@ -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"}
|
||||
Reference in new issue
Block a user