Kaveen Kumarasinghe 2 years ago
commit 53235e4e1d

@ -98,6 +98,7 @@ class GPT3ComCon(commands.Cog, name="GPT3ComCon"):
async def on_member_join(self, member): async def on_member_join(self, member):
if self.model.welcome_message_enabled: if self.model.welcome_message_enabled:
query = f"Please generate a welcome message for {member.name} who has just joined the server." query = f"Please generate a welcome message for {member.name} who has just joined the server."
try: try:
welcome_message = self.model.send_request(query, tokens=self.usage_service.count_tokens(query)) welcome_message = self.model.send_request(query, tokens=self.usage_service.count_tokens(query))
except: except:

@ -57,8 +57,8 @@ class EnvService:
@staticmethod @staticmethod
def get_welcome_message(): def get_welcome_message():
# WELCOME_MESSAGE is a default string used to welcome new members to the server if GPT3 is not available. # WELCOME_MESSAGE is a default string used to welcome new members to the server if GPT3 is not available.
#The string can be blank but this is not advised. If a string cannot be found in the .env file, the below string is used. # The string can be blank but this is not advised. If a string cannot be found in the .env file, the below string is used.
#The string is DMd to the new server member as part of an embed. # The string is DMd to the new server member as part of an embed.
try: try:
welcome_message = os.getenv("WELCOME_MESSAGE") welcome_message = os.getenv("WELCOME_MESSAGE")
except: except:

@ -92,7 +92,6 @@ class Model:
else: else:
raise ValueError("Value must be either true or false!") raise ValueError("Value must be either true or false!")
@property @property
def summarize_threshold(self): def summarize_threshold(self):
return self._summarize_threshold return self._summarize_threshold

Loading…
Cancel
Save