Closed zenghaojim33 closed 4 months ago
将292行的async def gemini_private_handler(message: Message):函数改成以下内容:
async def gemini_private_handler(message: Message):
m = message.text.strip()
player = None
# Check if the player is already in gemini_player_dict.
if str(message.from_user.id) not in gemini_pro_player_dict:
player = await make_new_gemini_pro_convo()
gemini_pro_player_dict[str(message.from_user.id)] = player
else:
player = gemini_pro_player_dict[str(message.from_user.id)]
# Control the length of the history record.
if len(player.history) > 10:
player.history = player.history[2:]
try:
sent_message = await bot.reply_to(message, before_generate_info)
await send_message(player, m)
try:
await bot.edit_message_text(escape(player.last.text), chat_id=sent_message.chat.id, message_id=sent_message.message_id, parse_mode="MarkdownV2")
except:
await bot.edit_message_text(escape(player.last.text), chat_id=sent_message.chat.id, message_id=sent_message.message_id)
except Exception:
traceback.print_exc()
await bot.reply_to(message, error_info)
但这会产生一个问题,不能在私聊中使用gemini-pro1.0,因为我把私聊中的/gemini命令禁止了,晚点可能会修改一下源代码
加了个switch命令,可以用 /switch 更改默认的模型
I don't want to add /gemini_pro for every questions I send, is there a way to default the model to 1.5 pro? Thanks!