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 Sep 18, 2024
1 parent 789953b commit 8a40f3c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/tools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import argparse
import ast
# import math

# LangGraph imports for using tools
import os
Expand All @@ -12,14 +11,14 @@
from jupyter_ai_magics.providers import BaseProvider
from langchain.chains import ConversationalRetrievalChain, LLMChain
from langchain.memory import ConversationBufferWindowMemory
# from langchain_anthropic import ChatAnthropic

# Chat Providers (add more as needed)
# from langchain_aws import ChatBedrock
# from langchain_cohere import ChatCohere
from langchain_core.messages import AIMessage
from langchain_core.prompts import PromptTemplate
from langchain_core.tools import tool

# from langchain_google_genai import ChatGoogleGenerativeAI
# from langchain_ollama import ChatOllama
# from langchain_openai import AzureChatOpenAI, ChatOpenAI
Expand All @@ -28,6 +27,15 @@

from .base import BaseChatHandler, SlashCommandRoutingType

# import math



# from langchain_anthropic import ChatAnthropic




PROMPT_TEMPLATE = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.
Chat History:
Expand Down Expand Up @@ -95,7 +103,6 @@ def create_llm_chain(
llm=self.llm, prompt=CONDENSE_PROMPT, memory=memory, verbose=False
)


def conditional_continue(self, state: MessagesState) -> Literal["tools", "__end__"]:
messages = state["messages"]
last_message = messages[-1]
Expand Down Expand Up @@ -141,7 +148,6 @@ def getToolNames(self, tools_file_path):
except FileNotFoundError as e: # to do
self.reply(f"Tools file not found at {tools_file_path}.")


def useLLMwithTools(self, query):
"""
LangGraph documentation : https://langchain-ai.github.io/langgraph/tutorials/introduction/
Expand Down

0 comments on commit 8a40f3c

Please sign in to comment.