From c51a8ae7133ce4d01ee7fe7266fced4627195add Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:54:01 +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/tools.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/jupyter-ai/jupyter_ai/chat_handlers/tools.py b/packages/jupyter-ai/jupyter_ai/chat_handlers/tools.py index 248966786..11281dcb2 100644 --- a/packages/jupyter-ai/jupyter_ai/chat_handlers/tools.py +++ b/packages/jupyter-ai/jupyter_ai/chat_handlers/tools.py @@ -171,7 +171,7 @@ def conditional_continue(state: MessagesState) -> Literal["tools", "__end__"]: messages = state["messages"] last_message = messages[-1] # if last_message.tool_calls: - if hasattr(last_message, 'tool_calls') and last_message.tool_calls: + if hasattr(last_message, "tool_calls") and last_message.tool_calls: return "tools" return "__end__" @@ -226,7 +226,9 @@ def get_tools(file_paths: list): try: self.model_with_tools = self.llm.__class__( model_id=self.llm.model_id - ).bind_tools(tools) # type:ignore[attr-defined] + ).bind_tools( + tools + ) # type:ignore[attr-defined] except AttributeError: raise ExceptionModelDoesTakeTools() except Exception: