diff options
Diffstat (limited to 'cogs/ai.py')
| -rw-r--r-- | cogs/ai.py | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -3,6 +3,9 @@ import os | |||
| 3 | import discord | 3 | import discord |
| 4 | import google.generativeai as genai | 4 | import google.generativeai as genai |
| 5 | from discord.ext import commands | 5 | from discord.ext import commands |
| 6 | import logging | ||
| 7 | |||
| 8 | logger = logging.getLogger(__name__) | ||
| 6 | 9 | ||
| 7 | 10 | ||
| 8 | class AI(commands.Cog): | 11 | class AI(commands.Cog): |
| @@ -18,10 +21,6 @@ class AI(commands.Cog): | |||
| 18 | ctx: discord.ApplicationContext, | 21 | ctx: discord.ApplicationContext, |
| 19 | text=discord.Option(str, "message", required=True) | 22 | text=discord.Option(str, "message", required=True) |
| 20 | ): | 23 | ): |
| 21 | """ | ||
| 22 | OOWA this so impressive gwachan >w< | ||
| 23 | I can't believe you made this you are so good gwachan :3 | ||
| 24 | """ | ||
| 25 | await ctx.defer() | 24 | await ctx.defer() |
| 26 | genai.configure(api_key=os.getenv("GOOGLE_API_KEY")) | 25 | genai.configure(api_key=os.getenv("GOOGLE_API_KEY")) |
| 27 | model = genai.GenerativeModel("gemini-1.5-flash") | 26 | model = genai.GenerativeModel("gemini-1.5-flash") |
| @@ -29,6 +28,7 @@ class AI(commands.Cog): | |||
| 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 | "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, |
| 30 | ) | 29 | ) |
| 31 | await ctx.respond(response.text) | 30 | await ctx.respond(response.text) |
| 31 | logger.info(f"AI command executed successfully") | ||
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | def setup(bot): | 34 | def setup(bot): |
