aboutsummaryrefslogtreecommitdiffstats
path: root/cogs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cogs/jarvis.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/cogs/jarvis.py b/cogs/jarvis.py
index b199c8a..bdb34f1 100644
--- a/cogs/jarvis.py
+++ b/cogs/jarvis.py
@@ -12,6 +12,7 @@ import logging
12import shutil 12import shutil
13from dotenv import load_dotenv 13from dotenv import load_dotenv
14import os 14import os
15from tempfile import NamedTemporaryFile
15from cogs.downloader import Downloader 16from cogs.downloader import Downloader
16 17
17logger = logging.getLogger(__name__) 18logger = logging.getLogger(__name__)
@@ -48,7 +49,7 @@ class Jarvis(commands.Cog):
48 response_message, action = Jarvis._parse_response(response_data) 49 response_message, action = Jarvis._parse_response(response_data)
49 50
50 channel = message.channel 51 channel = message.channel
51 await channel.send(response_message) 52 await message.reply(response_message)
52 53
53 if action == "download": 54 if action == "download":
54 await Jarvis._handle_download_action(message, channel) 55 await Jarvis._handle_download_action(message, channel)
@@ -57,15 +58,17 @@ class Jarvis(commands.Cog):
57 def _build_messages(message): 58 def _build_messages(message):
58 messages = [{ 59 messages = [{
59 "role": "system", 60 "role": "system",
60 "content": "your task is to tell the program what to do and how to respond after receiving a message.\n" 61 "content": "your name is Senator Sperma.\n"
62 "your task is to tell the program what to do and how to respond after receiving a message.\n"
61 "message field has to be filled out in polish.\n" 63 "message field has to be filled out in polish.\n"
62 "act like jarvis, be a personal assistant to user, do not use emojis\n" 64 "act like jarvis (only behavior wise), be a personal assistant to user, do not use emojis\n"
63 "do not ask the user if they want to do an action. the user will tell you that" 65 "do not ask the user if they want to do an action. the user will tell you that."
64 }] 66 }]
65 67
66 messages.append({ 68 messages.append({
67 "role": "user", 69 "role": "user",
68 "content": f"[from {message.author.display_name}]: {message.content}" 70 "content": f"{message.author.display_name}: {message.content}"
71
69 }) 72 })
70 73
71 if Jarvis._is_reply(message): 74 if Jarvis._is_reply(message):
@@ -83,11 +86,11 @@ class Jarvis(commands.Cog):
83 return [ 86 return [
84 { 87 {
85 "role": "user", 88 "role": "user",
86 "content": f"[original message from {original_msg.author.display_name}]: {original_msg.content}" 89 "content": f"{original_msg.author.display_name}: {original_msg.content}"
87 }, 90 },
88 { 91 {
89 "role": "user", 92 "role": "user",
90 "content": f"[reply from {message.author.display_name}]: {message.content}" 93 "content": f"{message.author.display_name}: {message.content}"
91 } 94 }
92 ] 95 ]
93 96