diff --git a/backend/requirements.txt b/backend/requirements.txt index 429cf19..ff46e02 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -18,3 +18,4 @@ python-multipart==0.0.12 apscheduler==3.10.4 pytz==2024.2 ta==0.11.0 +lxml>=5.0.0 diff --git a/backend/services/ai_analyzer.py b/backend/services/ai_analyzer.py index c7b053a..4388384 100644 --- a/backend/services/ai_analyzer.py +++ b/backend/services/ai_analyzer.py @@ -738,7 +738,9 @@ Return ONLY this valid JSON: # Extract the return-schema portion from `user` so batches use the identical full schema # (includes bucket id/label/max definitions that GPT-4o needs to populate correctly) - _return_schema = user.split("Retourne UNIQUEMENT ce JSON valide:\n", 1)[1] + _split_key = "Return ONLY this valid JSON:\n" + _parts = user.split(_split_key, 1) + _return_schema = _parts[1] if len(_parts) == 2 else user # Build lessons feedback block for the scorer lessons_header = "" diff --git a/backend/services/database.py b/backend/services/database.py index 91190d2..edbe761 100644 --- a/backend/services/database.py +++ b/backend/services/database.py @@ -4,7 +4,7 @@ SQLite persistence layer for portfolio positions, custom patterns, and config. import sqlite3 import json import os -from datetime import datetime +from datetime import datetime, timedelta from typing import List, Dict, Any, Optional DB_PATH = os.path.join(os.path.dirname(__file__), "..", "data", "geooptions.db")