mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-02 10:44:50 +00:00
Change gpt model and some fix
This commit is contained in:
parent
e99fb06724
commit
a4ad5c1730
4 changed files with 15 additions and 12 deletions
|
|
@ -20,16 +20,19 @@ async def chatbot(c, m):
|
|||
}
|
||||
|
||||
json_data = {
|
||||
"model": "text-davinci-003",
|
||||
"prompt": pertanyaan,
|
||||
"max_tokens": 200,
|
||||
"temperature": 0,
|
||||
"model": "gpt-3.5-turbo",
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": pertanyaan,
|
||||
},
|
||||
],
|
||||
}
|
||||
msg = await kirimPesan(m, "Wait a moment looking for your answer..")
|
||||
try:
|
||||
response = (await http.post("https://api.openai.com/v1/completions", headers=headers, json=json_data)).json()
|
||||
await editPesan(msg, response["choices"][0]["text"])
|
||||
response = (await http.post("https://api.openai.com/v1/chat/completions", headers=headers, json=json_data)).json()
|
||||
await editPesan(msg, response["choices"][0]["message"]["content"])
|
||||
except MessageNotModified:
|
||||
pass
|
||||
except Exception:
|
||||
await editPesan(msg, "Yahh, sorry i can't get your answer.")
|
||||
except Exception as err:
|
||||
await editPesan(msg, f"Oppss. ERROR: {err}")
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ async def imdb_id_callback(_, query):
|
|||
ott = await search_jw(r_json.get("name"), "ID")
|
||||
typee = r_json.get("@type", "")
|
||||
res_str = ""
|
||||
tahun = re.findall("\d{4}", sop.title.text)[0] if re.findall("\d{4}", sop.title.text) else "N/A"
|
||||
tahun = re.findall("\((\d{4})\)", sop.title.text)[0] if re.findall("\((\d{4})\)", sop.title.text) else "N/A"
|
||||
res_str += f"<b>📹 Judul:</b> <a href='{url}'>{r_json.get('name')} [{tahun}]</a> (<code>{typee}</code>)\n"
|
||||
if aka := r_json.get("alternateName"):
|
||||
res_str += f"<b>📢 AKA:</b> <code>{aka}</code>\n\n"
|
||||
|
|
@ -415,7 +415,7 @@ async def imdb_en_callback(bot, query):
|
|||
ott = await search_jw(r_json.get("name"), "US")
|
||||
typee = r_json.get("@type", "")
|
||||
res_str = ""
|
||||
tahun = re.findall("\d{4}", sop.title.text)[0] if re.findall("\d{4}", sop.title.text) else "N/A"
|
||||
tahun = re.findall("\((\d{4})\)", sop.title.text)[0] if re.findall("\((\d{4})\)", sop.title.text) else "N/A"
|
||||
res_str += f"<b>📹 Judul:</b> <a href='{url}'>{r_json.get('name')} [{tahun}]</a> (<code>{typee}</code>)\n"
|
||||
if aka := r_json.get("alternateName"):
|
||||
res_str += f"<b>📢 AKA:</b> <code>{aka}</code>\n\n"
|
||||
|
|
|
|||
|
|
@ -550,7 +550,7 @@ async def imdb_inl(_, query):
|
|||
ott = await search_jw(r_json["name"], "en_ID")
|
||||
res_str = ""
|
||||
typee = r_json.get("@type", "")
|
||||
tahun = re.findall("\d{4}", sop.title.text)[0] if re.findall("\d{4}", sop.title.text) else "N/A"
|
||||
tahun = re.findall("\((\d{4})\)", sop.title.text)[0] if re.findall("\((\d{4})\)", sop.title.text) else "N/A"
|
||||
res_str += f"<b>📹 Judul:</b> <a href='{url}'>{r_json['name']} [{tahun}]</a> (<code>{typee}</code>)\n"
|
||||
if r_json.get("alternateName"):
|
||||
res_str += f"<b>📢 AKA:</b> <code>{r_json.get('alternateName')}</code>\n\n"
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ async def getDataMovieku(msg, kueri, CurrentPage):
|
|||
async def getDataSavefilm21(msg, kueri, CurrentPage, user):
|
||||
if not SCRAP_DICT.get(msg.id):
|
||||
sfdata = []
|
||||
data = await http.get(f"https://45.136.197.138/?s={kueri}", headers=headers)
|
||||
data = await http.get(f"https://193.43.104.235/?s={kueri}", headers=headers)
|
||||
text = BeautifulSoup(data, "lxml")
|
||||
entry = text.find_all(class_="entry-header")
|
||||
if "Tidak Ditemukan" in entry[0].text:
|
||||
|
|
|
|||
Loading…
Reference in a new issue