added RAG, Multiuser, TG bot
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user