mirror of
				https://github.com/cdryzun/tg_bot_collections.git
				synced 2025-11-04 16:56:43 +08:00 
			
		
		
		
	feat: add summary and search commands (#54)
* feat: add summary and search commands Signed-off-by: Frost Ming <me@frostming.com> * fix formats Signed-off-by: Frost Ming <me@frostming.com> * fix: clean up Signed-off-by: Frost Ming <me@frostming.com>
This commit is contained in:
		@ -1,16 +1,15 @@
 | 
			
		||||
from os import environ
 | 
			
		||||
import time
 | 
			
		||||
from os import environ
 | 
			
		||||
 | 
			
		||||
from expiringdict import ExpiringDict
 | 
			
		||||
from groq import Groq
 | 
			
		||||
from telebot import TeleBot
 | 
			
		||||
from telebot.types import Message
 | 
			
		||||
from expiringdict import ExpiringDict
 | 
			
		||||
 | 
			
		||||
from . import *
 | 
			
		||||
 | 
			
		||||
from groq import Groq
 | 
			
		||||
from telegramify_markdown import convert
 | 
			
		||||
from telegramify_markdown.customize import markdown_symbol
 | 
			
		||||
 | 
			
		||||
from ._utils import bot_reply_first, bot_reply_markdown, enrich_text_with_urls, logger
 | 
			
		||||
 | 
			
		||||
markdown_symbol.head_level_1 = "📌"  # If you want, Customizing the head level 1 symbol
 | 
			
		||||
markdown_symbol.link = "🔗"  # If you want, Customizing the link symbol
 | 
			
		||||
 | 
			
		||||
@ -75,8 +74,8 @@ def llama_handler(message: Message, bot: TeleBot) -> None:
 | 
			
		||||
                }
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
    except Exception as e:
 | 
			
		||||
        print(e)
 | 
			
		||||
    except Exception:
 | 
			
		||||
        logger.exception("Llama handler error")
 | 
			
		||||
        bot.reply_to(message, "answer wrong maybe up to the max token")
 | 
			
		||||
        # pop my user
 | 
			
		||||
        player_message.pop()
 | 
			
		||||
@ -148,8 +147,8 @@ def llama_pro_handler(message: Message, bot: TeleBot) -> None:
 | 
			
		||||
            }
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    except Exception as e:
 | 
			
		||||
        print(e)
 | 
			
		||||
    except Exception:
 | 
			
		||||
        logger.exception("Llama Pro handler error")
 | 
			
		||||
        bot.reply_to(message, "answer wrong maybe up to the max token")
 | 
			
		||||
        player_message.clear()
 | 
			
		||||
        return
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user