From b766edfde2249b0cc740f15734da5bde2c71b309 Mon Sep 17 00:00:00 2001 From: OoO Date: Tue, 28 Apr 2026 12:26:43 +0800 Subject: [PATCH] fix: store_conversation signature, MCP model, and AI fallback message --- routes/openclaw_bot_routes.py | 6 +++--- services/mcp_collector_service.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/routes/openclaw_bot_routes.py b/routes/openclaw_bot_routes.py index a500b4e..f0065d8 100644 --- a/routes/openclaw_bot_routes.py +++ b/routes/openclaw_bot_routes.py @@ -4111,7 +4111,7 @@ def openclaw_answer(question: str): if _LEARNING_ENABLED: import threading as _thr _thr.Thread(target=store_conversation, - args=(0, 0, question, resp.content, "ollama", []), + args=(chat_id, question, resp.content), daemon=True).start() return resp.content, None else: @@ -4212,7 +4212,7 @@ def openclaw_answer(question: str): if _LEARNING_ENABLED: import threading as _thr _thr.Thread(target=store_conversation, - args=(0, 0, question, final, ",".join(used_sources), used_sources), + args=(chat_id, question, final), daemon=True).start() return final, None @@ -4272,7 +4272,7 @@ def openclaw_answer(question: str): except Exception as e: sys_log.error(f"[FC] NIM fallback error: {e}") - return "(AI 引擎暫時無法使用,請稍後再試)", None + return "(AI 引擎全部異常:Ollama 超時,Gemini/NIM 備援亦無回應或達速率限制,請稍後再試)", None diff --git a/services/mcp_collector_service.py b/services/mcp_collector_service.py index 16dba43..3c88652 100644 --- a/services/mcp_collector_service.py +++ b/services/mcp_collector_service.py @@ -28,7 +28,7 @@ logger = logging.getLogger(__name__) GEMINI_API_KEY = os.getenv("GEMINI_API_KEY", "") MCP_CACHE_TTL_HOURS = int(os.getenv("MCP_CACHE_TTL_HOURS", "24")) -MCP_MODEL = os.getenv("MCP_GEMINI_MODEL", "gemini-2.5-flash-preview-05-20") +MCP_MODEL = os.getenv("MCP_GEMINI_MODEL", "gemini-2.0-flash") # ── 查詢主題定義 ──────────────────────────────────────────────────────────── _SEARCH_TOPICS = {