Spaces:
Running
Running
fix: use standard json module for parsing to avoid langchain version conflicts
Browse files
app/services/k2_think_engine.py
CHANGED
|
@@ -141,11 +141,10 @@ RESEARCHER PROFILE:
|
|
| 141 |
else:
|
| 142 |
clean_json = content_no_think.replace("```json", "").replace("```", "").strip()
|
| 143 |
|
| 144 |
-
# Parser le JSON nettoyé
|
| 145 |
try:
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
k2_analysis = parse_json_markdown(clean_json)
|
| 149 |
except Exception as e:
|
| 150 |
logger.error(f"Failed to parse cleaned JSON: {e}")
|
| 151 |
logger.debug(f"Cleaned JSON was: {clean_json}")
|
|
|
|
| 141 |
else:
|
| 142 |
clean_json = content_no_think.replace("```json", "").replace("```", "").strip()
|
| 143 |
|
| 144 |
+
# Parser le JSON nettoyé avec le module JSON standard
|
| 145 |
try:
|
| 146 |
+
import json
|
| 147 |
+
k2_analysis = json.loads(clean_json)
|
|
|
|
| 148 |
except Exception as e:
|
| 149 |
logger.error(f"Failed to parse cleaned JSON: {e}")
|
| 150 |
logger.debug(f"Cleaned JSON was: {clean_json}")
|