fix(telegram): fix chat_id routing and llm result unpacking
All checks were successful
E2E Health Check / e2e-health (push) Successful in 18s

This commit is contained in:
OG T
2026-03-31 15:56:58 +08:00
parent a0c3a3bc8a
commit 8b7f99b5fa
2 changed files with 5 additions and 4 deletions

View File

@@ -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

View File

@@ -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)"""