diff --git a/platform/backend/app/api/system.py b/platform/backend/app/api/system.py index 5d2153c..4c4df96 100644 --- a/platform/backend/app/api/system.py +++ b/platform/backend/app/api/system.py @@ -193,7 +193,7 @@ def get_modules_status(): "scheduled_optimize_sources": {"name": "πŸ“‘ δΏ‘ζ―ζΊδΌ˜εŒ–", "log": LOGS_DIR / f"optimizer_sources_{today_str}.log"}, "scheduled_metrics_sync": {"name": "πŸ“Š ζŒ‡ζ ‡εŒζ­₯", "log": LOGS_DIR / f"metrics_sync_{today_str}.log"}, } - jobs = {j.id: j for j in scheduler.get_jobs()} + jobs = {j['id']: j for j in scheduler.get_jobs()} modules = [] for mod_id, cfg in log_based.items(): log_file = cfg["log"] diff --git a/platform/backend/app/core/nvidia_client.py b/platform/backend/app/core/nvidia_client.py index 03e7b45..72a9a11 100644 --- a/platform/backend/app/core/nvidia_client.py +++ b/platform/backend/app/core/nvidia_client.py @@ -110,7 +110,8 @@ def call_llm( if resp.status_code != 200: raise LLMError(f"HTTP {resp.status_code}: {resp.text[:200]}") if stream: - full = [] + content_parts = [] + reasoning_parts = [] for line in resp.iter_lines(): if not line: continue if line.startswith(b'data: '): @@ -119,12 +120,14 @@ def call_llm( try: chunk = json.loads(data) delta = chunk['choices'][0]['delta'] - if delta.get('reasoning_content'): - full.append(delta['reasoning_content']) if delta.get('content'): - full.append(delta['content']) + content_parts.append(delta['content']) + if delta.get('reasoning_content'): + reasoning_parts.append(delta['reasoning_content']) except Exception: continue - return "".join(full) + if content_parts: + return "".join(content_parts) + return "".join(reasoning_parts) else: data = resp.json() msg = data["choices"][0]["message"]