-
Notifications
You must be signed in to change notification settings - Fork 19
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
base: master
Are you sure you want to change the base?
Conversation
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." ) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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?
No description provided.