Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ from langchain.tools import Tool
|
|
5 |
from langchain.agents import initialize_agent
|
6 |
from langchain.agents import AgentType
|
7 |
from langchain.tools import DuckDuckGoSearchRun
|
|
|
8 |
import os
|
9 |
|
10 |
|
@@ -21,7 +22,8 @@ search_tool = Tool(
|
|
21 |
|
22 |
# Create LangChain agent
|
23 |
agent = initialize_agent(
|
24 |
-
tools
|
|
|
25 |
llm=llm,
|
26 |
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
|
27 |
verbose=True
|
|
|
5 |
from langchain.agents import initialize_agent
|
6 |
from langchain.agents import AgentType
|
7 |
from langchain.tools import DuckDuckGoSearchRun
|
8 |
+
from google.ai.generativelanguage_v1beta.types import Tool as GenAITool
|
9 |
import os
|
10 |
|
11 |
|
|
|
22 |
|
23 |
# Create LangChain agent
|
24 |
agent = initialize_agent(
|
25 |
+
tools=#[search_tool],
|
26 |
+
[GenAITool(google_search={})],
|
27 |
llm=llm,
|
28 |
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
|
29 |
verbose=True
|