From 025029f72b3177c5494b87fa7cfc7500fb4d72bf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 16:06:06 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- packages/jupyter-ai/jupyter_ai/chat_handlers/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/jupyter-ai/jupyter_ai/chat_handlers/base.py b/packages/jupyter-ai/jupyter_ai/chat_handlers/base.py index d0e97aecb..ffd15cc2c 100644 --- a/packages/jupyter-ai/jupyter_ai/chat_handlers/base.py +++ b/packages/jupyter-ai/jupyter_ai/chat_handlers/base.py @@ -267,9 +267,11 @@ def get_llm_chain(self): if not lm_provider or not lm_provider_params: return None - if len(self._chat_history) <= 2: # Check if chat history has been cleared, then reinitialize the llm chain + if ( + len(self._chat_history) <= 2 + ): # Check if chat history has been cleared, then reinitialize the llm chain self.log.info("Clear conversation memory, re-initializing the llm chain.") - self.create_llm_chain(lm_provider, lm_provider_params) + self.create_llm_chain(lm_provider, lm_provider_params) elif curr_lm_id != next_lm_id: self.log.info( f"Switching chat language model from {curr_lm_id} to {next_lm_id}."