Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom error messages and dynamic response size #262

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

aaj2005
Copy link
Contributor

@aaj2005 aaj2005 commented Aug 22, 2024

No description provided.

cutoff = message_time + timedelta(minutes=CONFIG.SUMMARISE_COOLDOWN)
# check that message time + cooldown time period is still in the future
if now < cutoff:
await ctx.reply("STFU!! Wait " + str(int((cutoff - now).total_seconds())) + " Seconds. You are on Cool Down." )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe remove STFU

else:
self.cooldowns[ctx.channel.id] = [now, 1] # reset the cooldown
else:
self.cooldowns[ctx.channel.id][1]+=1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did ruff not pick up on spaces either side of the +=?

@@ -29,6 +29,7 @@ def __init__(self, filepath: str):
self.LIEGE_CHANCELLOR_ID: int = parsed.get("liege_chancellor_id")
self.SUMMARISE_LIMIT: int = parsed.get("summarise_limit")
self.SUMMARISE_COOLDOWN: int = parsed.get("summarise_cooldown")
self.SUMMARISE_MESSAGE_LIMIT: int = parsed.get("summarise_message_limit")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember when you deploy this to add this to the config file on beryillum

def build_prompt(self, bullet_points, channel_name, response_size):

bullet_points = "Put it in bullet points for readability." if bullet_points else ""
prompt = f"""People yap too much, I don't want to read all of it. The topic is related to {channel_name}. In {response_size} words or less give me the gist of what is being said. {bullet_points} Note that the messages are in reverse chronological order:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this to the config file too, so we can experiment slightly

I reckon this could do with a bit of prompt tuning, I don't really know what I'm talking about, but maybe something like this one. At least something to make it waffle less and be more precise

async for msg in message_chain:
if CONFIG.AI_INCLUDE_NAMES and msg.author != self.bot.user:
initial += msg.author.name + ":" + msg.content + "\n"

message_length += len(msg.content.split())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you want to add the thing to only go back as far as the last tldr (perhaps with an option to override)
What exactly is the point of message_length?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants