Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 19, 2024
1 parent c992b6c commit 025029f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}."
Expand Down

0 comments on commit 025029f

Please sign in to comment.