Update agent.py
Browse files
agent.py
CHANGED
|
@@ -4,8 +4,7 @@ from langgraph.prebuilt import ToolNode
|
|
| 4 |
from langgraph.graph import START, StateGraph
|
| 5 |
from langgraph.prebuilt import tools_condition
|
| 6 |
from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace
|
| 7 |
-
from tools import extract_text, describe_image
|
| 8 |
-
from langchain_community.tools import DuckDuckGoSearchRun
|
| 9 |
from langchain_openai import ChatOpenAI
|
| 10 |
from typing import TypedDict, Annotated, Optional
|
| 11 |
|
|
@@ -18,9 +17,8 @@ class BasicAgent():
|
|
| 18 |
def __init__(self, llm):
|
| 19 |
chat = ChatHuggingFace(llm=llm, verbose=True)
|
| 20 |
|
| 21 |
-
search_tool = DuckDuckGoSearchRun()
|
| 22 |
vision_llm = ChatOpenAI(model="gpt-4o")
|
| 23 |
-
self.tools = [extract_text, describe_image,
|
| 24 |
self.chat_with_tools = vision_llm.bind_tools(self.tools) # need to change
|
| 25 |
self._initialize_graph()
|
| 26 |
print("BasicAgent initialized.")
|
|
|
|
| 4 |
from langgraph.graph import START, StateGraph
|
| 5 |
from langgraph.prebuilt import tools_condition
|
| 6 |
from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace
|
| 7 |
+
from tools import extract_text, describe_image, wiki_search, web_search, arxiv_search
|
|
|
|
| 8 |
from langchain_openai import ChatOpenAI
|
| 9 |
from typing import TypedDict, Annotated, Optional
|
| 10 |
|
|
|
|
| 17 |
def __init__(self, llm):
|
| 18 |
chat = ChatHuggingFace(llm=llm, verbose=True)
|
| 19 |
|
|
|
|
| 20 |
vision_llm = ChatOpenAI(model="gpt-4o")
|
| 21 |
+
self.tools = [extract_text, describe_image, wiki_search, web_search, arxiv_search]
|
| 22 |
self.chat_with_tools = vision_llm.bind_tools(self.tools) # need to change
|
| 23 |
self._initialize_graph()
|
| 24 |
print("BasicAgent initialized.")
|