From 69bd4fca907153ebb838134d79ebfd4674b7b06c Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Thu, 6 Jun 2024 01:09:38 +0100 Subject: [PATCH] Fix generate_truth not limiting correctly --- src/cogs/ollama.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cogs/ollama.py b/src/cogs/ollama.py index 50f67c1..e6d094a 100644 --- a/src/cogs/ollama.py +++ b/src/cogs/ollama.py @@ -1044,7 +1044,8 @@ class Ollama(commands.Cog): "\n\nAfter reading through all" " of your previous truth posts, you should generate another one, ready to be posted, " "under 4000 characters. Write only the content to be posted, do not include any pleasantries." - " Write using the style of a twitter or facebook post. Do not repeat a previous post." + " Write using the style of a twitter or facebook post. Do not repeat a previous post or any previous " + "content." ) thread_id = self.history.create_thread( ctx.author, @@ -1067,6 +1068,7 @@ class Ollama(commands.Cog): truths = list(filter(lambda t: t.author == entity, truths)) if limit: truths.sort(key=lambda t: t.timestamp, reverse=True) # newest first + truths = truths[:limit] for truth in truths: await asyncio.to_thread(