Spaces:
Runtime error
Runtime error
Update Hellbot/plugins/user/gemini.py
Browse files
Hellbot/plugins/user/gemini.py
CHANGED
@@ -1,13 +1,16 @@
|
|
1 |
import asyncio
|
2 |
import json
|
3 |
import requests
|
|
|
4 |
from pyrogram import Client
|
5 |
from pyrogram.types import Message
|
6 |
from . import on_message, hellbot, HelpMenu
|
7 |
|
8 |
# Define the Gemini API function
|
9 |
def gemini(args: str) -> str:
|
10 |
-
url =
|
|
|
|
|
11 |
headers = {"Content-Type": "application/json"}
|
12 |
payload = {"contents": [{"parts": [{"text": args}]}]}
|
13 |
|
@@ -32,8 +35,6 @@ async def gemini_handler(client: Client, message: Message):
|
|
32 |
user_input = user_input[1]
|
33 |
|
34 |
msg = await hellbot.edit(message, "Generating response...")
|
35 |
-
await asyncio.sleep(8)
|
36 |
-
await msg.delete()
|
37 |
|
38 |
try:
|
39 |
generated_text = gemini(user_input)
|
|
|
1 |
import asyncio
|
2 |
import json
|
3 |
import requests
|
4 |
+
from base64 import b64decode as m
|
5 |
from pyrogram import Client
|
6 |
from pyrogram.types import Message
|
7 |
from . import on_message, hellbot, HelpMenu
|
8 |
|
9 |
# Define the Gemini API function
|
10 |
def gemini(args: str) -> str:
|
11 |
+
url = m(
|
12 |
+
"aHR0cHM6Ly9nZW5lcmF0aXZlbGFuZ3VhZ2UuZ29vZ2xlYXBpcy5jb20vdjFiZXRhL21vZGVscy9nZW1pbmktcHJvOmdlbmVyYXRlQ29udGVudD9rZXk9QUl6YVN5QlFhb1VGLUtXalBWXzRBQnRTTjBEUTBSUGtOZUNoNHRN"
|
13 |
+
).decode("utf-8")
|
14 |
headers = {"Content-Type": "application/json"}
|
15 |
payload = {"contents": [{"parts": [{"text": args}]}]}
|
16 |
|
|
|
35 |
user_input = user_input[1]
|
36 |
|
37 |
msg = await hellbot.edit(message, "Generating response...")
|
|
|
|
|
38 |
|
39 |
try:
|
40 |
generated_text = gemini(user_input)
|