mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-07 12:24:51 +00:00
Handle if prompt contain blacklist
Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
parent
18a21ef093
commit
1358f23c2d
1 changed files with 3 additions and 1 deletions
|
|
@ -55,7 +55,9 @@ async def gemini_chatbot(_, ctx: Message, strings):
|
||||||
json=json_data,
|
json=json_data,
|
||||||
timeout=20.0,
|
timeout=20.0,
|
||||||
)
|
)
|
||||||
await msg.edit_msg(response.json()["candidates"][0]["content"]["parts"][0]["text"])
|
if response.json().get("promptFeedback"):
|
||||||
|
return await msg.edit_msg("⚠️ Sorry, the prompt you sent contains a forbidden word that is not permitted by AI.")
|
||||||
|
await msg.edit_msg(html.escape(response.json()["candidates"][0]["content"]["parts"][0]["text"]))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
await msg.edit_msg(str(e))
|
await msg.edit_msg(str(e))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue