From 0d05d68cba81ce3e0d6792cd4cb8e7e52e144c7c Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Tue, 4 Jun 2024 02:09:02 +0100 Subject: [PATCH] get_thread => find_thread --- src/cogs/ollama.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cogs/ollama.py b/src/cogs/ollama.py index 25170ac..d282a46 100644 --- a/src/cogs/ollama.py +++ b/src/cogs/ollama.py @@ -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