Spaces:
Configuration error
Configuration error
Enrico Mannarino commited on
Commit ·
42551f0
1
Parent(s): 65638f8
new
Browse files
agent.py
CHANGED
|
@@ -11,7 +11,7 @@ from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun, Ar
|
|
| 11 |
from langchain_community.utilities import WikipediaAPIWrapper, ArxivAPIWrapper
|
| 12 |
from langchain_community.tools.wikidata.tool import WikidataAPIWrapper, WikidataQueryRun
|
| 13 |
|
| 14 |
-
from
|
| 15 |
|
| 16 |
|
| 17 |
from tools import GetYouTubeTranscriptTool, ImageRecognitionTool
|
|
@@ -55,15 +55,14 @@ def build_graph():
|
|
| 55 |
else:
|
| 56 |
return "continue"
|
| 57 |
|
| 58 |
-
model =
|
| 59 |
-
image_model = ChatOpenAI(model="gpt-4o")
|
| 60 |
|
| 61 |
tools = [GetYouTubeTranscriptTool(),
|
| 62 |
WikidataQueryRun(api_wrapper=WikidataAPIWrapper()),
|
| 63 |
DuckDuckGoSearchRun(),
|
| 64 |
ArxivQueryRun(api_wrapper=ArxivAPIWrapper()),
|
| 65 |
WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()),
|
| 66 |
-
ImageRecognitionTool(hf_endpoint=
|
| 67 |
model = model.bind_tools(tools)
|
| 68 |
|
| 69 |
tool_node = ToolNode(tools)
|
|
|
|
| 11 |
from langchain_community.utilities import WikipediaAPIWrapper, ArxivAPIWrapper
|
| 12 |
from langchain_community.tools.wikidata.tool import WikidataAPIWrapper, WikidataQueryRun
|
| 13 |
|
| 14 |
+
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 15 |
|
| 16 |
|
| 17 |
from tools import GetYouTubeTranscriptTool, ImageRecognitionTool
|
|
|
|
| 55 |
else:
|
| 56 |
return "continue"
|
| 57 |
|
| 58 |
+
model = ChatGoogleGenerativeAI(model="gemini-2.0-flash", temperature=0)
|
|
|
|
| 59 |
|
| 60 |
tools = [GetYouTubeTranscriptTool(),
|
| 61 |
WikidataQueryRun(api_wrapper=WikidataAPIWrapper()),
|
| 62 |
DuckDuckGoSearchRun(),
|
| 63 |
ArxivQueryRun(api_wrapper=ArxivAPIWrapper()),
|
| 64 |
WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()),
|
| 65 |
+
ImageRecognitionTool(hf_endpoint=model)]
|
| 66 |
model = model.bind_tools(tools)
|
| 67 |
|
| 68 |
tool_node = ToolNode(tools)
|