Fix generate_truth not limiting correctly
All checks were successful
Build and Publish college-bot-v2 / build_and_publish (push) Successful in 13s
All checks were successful
Build and Publish college-bot-v2 / build_and_publish (push) Successful in 13s
This commit is contained in:
parent
e4d3d0fe56
commit
69bd4fca90
1 changed files with 3 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue