feat: claude opus

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
yihong0618
2024-03-18 15:09:36 +08:00
parent 2952b81521
commit 68ab644e4a
4 changed files with 118 additions and 11 deletions

View File

@ -52,6 +52,13 @@ def gemini_handler(message: Message, bot: TeleBot) -> None:
gemini_player_dict[str(message.from_user.id)] = player
else:
player = gemini_player_dict[str(message.from_user.id)]
if m.strip() == "clear":
bot.reply_to(
message,
"just clear you gemini messages history",
)
player.history.clear()
return
# keep the last 5, every has two ask and answer.
if len(player.history) > 10:
player.history = player.history[2:]