added RAG, Multiuser, TG bot

This commit is contained in:
2026-06-14 06:26:16 +00:00
parent c8a9429bed
commit 0c8ab6018a
24 changed files with 1280 additions and 479 deletions
+9 -2
View File
@@ -13,7 +13,8 @@ from bot.config import Settings
from bot.filters import IsLinked
from bot.ha_client import HaClient
from bot.sse import SseChunk
from bot.notify_worker import advance_cursors, send_text
from bot.notify_worker import advance_cursors
from bot.notice_delivery import send_notice_content
from bot.storage import LinkedUser, Storage
router = Router()
@@ -52,7 +53,13 @@ async def _run_chat_stream(
elif chunk.event == "notice":
content = str(chunk.data.get("content") or "").strip()
if content:
await send_text(message.bot, message.chat.id, content)
await send_notice_content(
message.bot,
message.chat.id,
content,
HaClient(settings.ha_api_base_url, linked.api_token),
ha_api_base=settings.ha_api_base_url,
)
elif chunk.event == "error":
err = str(chunk.data.get("message") or "Ошибка генерации")
await message.answer(err)