Fix RAG inference
This commit is contained in:
+3
-3
@@ -220,11 +220,11 @@ class TelegramHelper:
|
||||
if len(response_text) > constants.MessageLimit.MAX_TEXT_LENGTH:
|
||||
chunks = [response_text[i:i + constants.MessageLimit.MAX_TEXT_LENGTH] for i in range(0, len(response_text), constants.MessageLimit.MAX_TEXT_LENGTH)]
|
||||
for chunk_idx, chunk in enumerate(chunks):
|
||||
await update.message.reply_text(chunk, parse_mode=constants.ParseMode.HTML)
|
||||
await update.message.reply_text(chunk)
|
||||
if chunk_idx < len(chunks) - 1:
|
||||
await asyncio.sleep(self.chunk_message_sleep_duration)
|
||||
else:
|
||||
await update.message.reply_text(response_text, parse_mode=constants.ParseMode.HTML)
|
||||
await update.message.reply_text(response_text)
|
||||
else:
|
||||
logger.warning(f"Successful logic result but no response text for user {user_id}.")
|
||||
await update.message.reply_text("Something went unexpectedly well, but I have nothing to say.")
|
||||
@@ -262,7 +262,7 @@ class TelegramHelper:
|
||||
|
||||
async def browse(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||
# Assuming browse_command is defined elsewhere and compatible
|
||||
await browse_command(update, context, self.bot)
|
||||
await browse_command(update, context)
|
||||
|
||||
async def handle_button_callback(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||
# Assuming button_callback is defined elsewhere and compatible
|
||||
|
||||
Reference in New Issue
Block a user