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