aboutsummaryrefslogtreecommitdiffstats
path: root/cogs/ai.py
diff options
context:
space:
mode:
Diffstat (limited to 'cogs/ai.py')
-rw-r--r--cogs/ai.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/cogs/ai.py b/cogs/ai.py
index ded74d9..d2af796 100644
--- a/cogs/ai.py
+++ b/cogs/ai.py
@@ -1,7 +1,9 @@
1import os
2
1import discord 3import discord
2from discord.ext import commands
3import google.generativeai as genai 4import google.generativeai as genai
4import os 5from discord.ext import commands
6
5 7
6class AI(commands.Cog): 8class AI(commands.Cog):
7 def __init__(self, bot): 9 def __init__(self, bot):
@@ -12,22 +14,22 @@ class AI(commands.Cog):
12 description="SEENATOR", 14 description="SEENATOR",
13 ) 15 )
14 async def senator( 16 async def senator(
15 self, 17 self,
16 ctx: discord.ApplicationContext, 18 ctx: discord.ApplicationContext,
17 text = discord.Option(str, "message", required=True) 19 text=discord.Option(str, "message", required=True)
18 ): 20 ):
19 ''' 21 """
20 OOWA this so impressive gwachan >w< 22 OOWA this so impressive gwachan >w<
21 I can't believe you made this you are so good gwachan :3 23 I can't believe you made this you are so good gwachan :3
22 ''' 24 """
23 await ctx.defer() 25 await ctx.defer()
24 genai.configure(api_key=os.getenv("GOOGLE_API_KEY")) 26 genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
25 model = genai.GenerativeModel("gemini-1.5-flash") 27 model = genai.GenerativeModel("gemini-1.5-flash")
26 response = model.generate_content( 28 response = model.generate_content(
27 "You are Senator Steaven Sperma Armstrong from Metal Gear Rising Vengeance. Respond in plain text, no ** or "". If the message is in Polish, respond in Polish. Respond in 100 words. Respond accordingly to this message: "+text, 29 "You are Senator Steaven Sperma Armstrong from Metal Gear Rising Vengeance. Respond in plain text, no ** or "". If the message is in Polish, respond in Polish. Respond in 100 words. Respond accordingly to this message: " + text,
28 ) 30 )
29 await ctx.respond(response.text) 31 await ctx.respond(response.text)
30 32
33
31def setup(bot): 34def setup(bot):
32 bot.add_cog(AI(bot)) 35 bot.add_cog(AI(bot))
33 \ No newline at end of file