diff --git a/apps/api/src/services/chat_manager.py b/apps/api/src/services/chat_manager.py index 3030bd53..36bce6e8 100644 --- a/apps/api/src/services/chat_manager.py +++ b/apps/api/src/services/chat_manager.py @@ -92,7 +92,7 @@ class ChatManager: try: # 優先使用 NVIDIA Nemo-4B - response, provider, success, tokens, cost = await self.nvidia.chat( + response, success, tokens, cost = await self.nvidia.chat( prompt=f"{system_prompt}\n\nCommander's Message: {message_text}", model="nvidia/nemotron-mini-4b-instruct", max_tokens=1024 diff --git a/apps/api/src/services/telegram_gateway.py b/apps/api/src/services/telegram_gateway.py index d32c03cf..891daeaf 100644 --- a/apps/api/src/services/telegram_gateway.py +++ b/apps/api/src/services/telegram_gateway.py @@ -2083,6 +2083,7 @@ class TelegramGateway: self, text: str, parse_mode: str = "HTML", + chat_id: str | int | None = None, ) -> dict: """ 發送純文字通知 @@ -2095,7 +2096,7 @@ class TelegramGateway: dict: API 回應 """ payload = { - "chat_id": self.chat_id, + "chat_id": chat_id or self.chat_id, "text": text[:500], # SOUL.md 字數限制 "parse_mode": parse_mode, } @@ -2382,8 +2383,8 @@ class TelegramGateway: message_text=text, ) - # 4. 回覆統帥 - await self.send_notification(response, parse_mode="HTML") + # 4. 回覆統帥 (定向回傳) + await self.send_notification(response, parse_mode="HTML", chat_id=chat_id) async def _send_chat_action(self, chat_id: int, action: str) -> None: """發送聊天狀態 (e.g., typing)"""