Fix update
Browse files- chatbot/plugins/chat.py +9 -4
chatbot/plugins/chat.py
CHANGED
@@ -357,6 +357,11 @@ async def deepsearchmode(client, callback):
|
|
357 |
@Client.on_callback_query(filters.regex("^modelmenu:([a-f0-9]{8})$"))
|
358 |
async def modelgeminimenu(client, callback):
|
359 |
uuidstr = callback.matches[0].group(1)
|
|
|
|
|
|
|
|
|
|
|
360 |
keyboard = []
|
361 |
keyboard.append([
|
362 |
InlineKeyboardButton("G Flash EXP", callback_data=f"us:gemini-2.0-flash-exp:{uuidstr}"),
|
@@ -1025,7 +1030,7 @@ async def chatbot_talk(client: Client, message: Message):
|
|
1025 |
with open(STREAM_IMAGE_PATH, 'rb') as f:
|
1026 |
image_bytes = f.read()
|
1027 |
async for chunk in await gen.aio.models.generate_content_stream(
|
1028 |
-
model=
|
1029 |
contents=[
|
1030 |
str(stream_image_now.group(1)),
|
1031 |
ty.Part.from_bytes(data=image_bytes, mime_type="image/jpeg")
|
@@ -1207,7 +1212,7 @@ async def chatbot_talk(client: Client, message: Message):
|
|
1207 |
if file_photo.state.name == "FAILED":
|
1208 |
return await message.reply_text(f"Error: {file_photo.state.name}")
|
1209 |
response = await gen.aio.models.generate_content(
|
1210 |
-
model=
|
1211 |
contents=[str(caption), file_photo]
|
1212 |
)
|
1213 |
uuid_code = str(uuid.uuid4())[:8]
|
@@ -1271,7 +1276,7 @@ async def chatbot_talk(client: Client, message: Message):
|
|
1271 |
if video_file.state.name == "FAILED":
|
1272 |
return await message.reply_text(f"Error: {video_file.state.name}")
|
1273 |
response = await gen.aio.models.generate_content(
|
1274 |
-
model=
|
1275 |
contents=[str(caption), video_file]
|
1276 |
)
|
1277 |
uuid_code = str(uuid.uuid4())[:8]
|
@@ -1334,7 +1339,7 @@ async def chatbot_talk(client: Client, message: Message):
|
|
1334 |
if sticker_file.state.name == "FAILED":
|
1335 |
return await message.reply_text(f"Error: {sticker_file.state.name}")
|
1336 |
response = await gen.aio.models.generate_content(
|
1337 |
-
model=
|
1338 |
contents=["funny random meme sticker words", sticker_file]
|
1339 |
)
|
1340 |
uuid_code = str(uuid.uuid4())[:8]
|
|
|
357 |
@Client.on_callback_query(filters.regex("^modelmenu:([a-f0-9]{8})$"))
|
358 |
async def modelgeminimenu(client, callback):
|
359 |
uuidstr = callback.matches[0].group(1)
|
360 |
+
user_id = callback.from_user.id
|
361 |
+
check_is_system = await db.backup_chatbot.find_one({"user_id": user_id})
|
362 |
+
if check_is_system and check_is_system.get("is_deepsearch", False):
|
363 |
+
await callback.answer(f"You can OFF in deep search", show_alert=True)
|
364 |
+
return
|
365 |
keyboard = []
|
366 |
keyboard.append([
|
367 |
InlineKeyboardButton("G Flash EXP", callback_data=f"us:gemini-2.0-flash-exp:{uuidstr}"),
|
|
|
1030 |
with open(STREAM_IMAGE_PATH, 'rb') as f:
|
1031 |
image_bytes = f.read()
|
1032 |
async for chunk in await gen.aio.models.generate_content_stream(
|
1033 |
+
model="gemini-1.5-flash",
|
1034 |
contents=[
|
1035 |
str(stream_image_now.group(1)),
|
1036 |
ty.Part.from_bytes(data=image_bytes, mime_type="image/jpeg")
|
|
|
1212 |
if file_photo.state.name == "FAILED":
|
1213 |
return await message.reply_text(f"Error: {file_photo.state.name}")
|
1214 |
response = await gen.aio.models.generate_content(
|
1215 |
+
model="gemini-1.5-flash",
|
1216 |
contents=[str(caption), file_photo]
|
1217 |
)
|
1218 |
uuid_code = str(uuid.uuid4())[:8]
|
|
|
1276 |
if video_file.state.name == "FAILED":
|
1277 |
return await message.reply_text(f"Error: {video_file.state.name}")
|
1278 |
response = await gen.aio.models.generate_content(
|
1279 |
+
model="gemini-1.5-flash",
|
1280 |
contents=[str(caption), video_file]
|
1281 |
)
|
1282 |
uuid_code = str(uuid.uuid4())[:8]
|
|
|
1339 |
if sticker_file.state.name == "FAILED":
|
1340 |
return await message.reply_text(f"Error: {sticker_file.state.name}")
|
1341 |
response = await gen.aio.models.generate_content(
|
1342 |
+
model="gemini-1.5-flash",
|
1343 |
contents=["funny random meme sticker words", sticker_file]
|
1344 |
)
|
1345 |
uuid_code = str(uuid.uuid4())[:8]
|