get_thread => find_thread
All checks were successful
Build and Publish college-bot-v2 / build_and_publish (push) Successful in 14s

This commit is contained in:
Nexus 2024-06-04 02:09:02 +01:00
parent 37bb148e8e
commit 0d05d68cba
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -529,7 +529,7 @@ class Ollama(commands.Cog):
return await ctx.respond("No servers available. Please try again later.")
system_query = None
if context is not None:
if not self.history.get_thread(context):
if not self.history.find_thread(context):
await ctx.respond("Invalid context key.")
return
@ -755,8 +755,7 @@ class Ollama(commands.Cog):
if context is None:
context = self.history.create_thread(ctx.user, system_query)
elif context is not None and self.history.get_thread(context) is None:
__thread = self.history.find_thread(context)
elif context is not None and (__thread := self.history.find_thread(context)) is None:
if not __thread:
return await ctx.respond("Invalid thread ID.")
else:
@ -768,7 +767,7 @@ class Ollama(commands.Cog):
user_message["images"] = [image_data]
messages.append(user_message)
params = {"seed": self.history.get_thread(context)["seed"]}
params = {"seed": self.history.find_thread(context)["seed"]}
if give_acid is True:
params["temperature"] = 2
params["top_k"] = 0