Update agent.py
Browse files
agent.py
CHANGED
|
@@ -4,7 +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
|
| 8 |
from langchain_openai import ChatOpenAI
|
| 9 |
from typing import TypedDict, Annotated, Optional
|
| 10 |
|
|
@@ -15,8 +15,7 @@ class AgentState(TypedDict):
|
|
| 15 |
|
| 16 |
class BasicAgent():
|
| 17 |
def __init__(self, chat, vision_llm):
|
| 18 |
-
self.
|
| 19 |
-
self.tools = [extract_text_from_image, read_excel, read_python, describe_image, wiki_search, web_search, arxiv_search]
|
| 20 |
self.chat_with_tools = chat.bind_tools(self.tools)
|
| 21 |
self._initialize_graph()
|
| 22 |
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 make_text_from_image_tool, make_describe_image_tool, read_excel, read_python, wiki_search, web_search, arxiv_search
|
| 8 |
from langchain_openai import ChatOpenAI
|
| 9 |
from typing import TypedDict, Annotated, Optional
|
| 10 |
|
|
|
|
| 15 |
|
| 16 |
class BasicAgent():
|
| 17 |
def __init__(self, chat, vision_llm):
|
| 18 |
+
self.tools = [make_text_from_image_tool(vision_llm), make_describe_image_tool(vision_llm), read_excel, read_python, wiki_search, web_search, arxiv_search]
|
|
|
|
| 19 |
self.chat_with_tools = chat.bind_tools(self.tools)
|
| 20 |
self._initialize_graph()
|
| 21 |
print("BasicAgent initialized.")
|