Spaces:
Runtime error
Runtime error
Update agent.py
Browse files
agent.py
CHANGED
@@ -43,9 +43,12 @@ from io import StringIO
|
|
43 |
from transformers import BertTokenizer, BertModel
|
44 |
import torch
|
45 |
import torch.nn.functional as F
|
46 |
-
from langchain.tools import Tool
|
47 |
from langchain.agents import initialize_agent, AgentType
|
48 |
from langchain_community.chat_models import ChatOpenAI
|
|
|
|
|
|
|
49 |
import time
|
50 |
|
51 |
load_dotenv()
|
@@ -444,10 +447,10 @@ retriever = vector_store.as_retriever()
|
|
444 |
# -------------------------------
|
445 |
# Step 6: Create LangChain Tools
|
446 |
# -------------------------------
|
447 |
-
wiki_tool = WikipediaAPIWrapper() # If it's a proper LangChain tool
|
448 |
calc_tool = calculator
|
449 |
file_tool = analyze_attachment
|
450 |
web_tool = web_search
|
|
|
451 |
arvix_tool = arvix_search
|
452 |
youtube_tool = get_youtube_transcript
|
453 |
video_tool = extract_video_id
|
|
|
43 |
from transformers import BertTokenizer, BertModel
|
44 |
import torch
|
45 |
import torch.nn.functional as F
|
46 |
+
#from langchain.tools import Tool
|
47 |
from langchain.agents import initialize_agent, AgentType
|
48 |
from langchain_community.chat_models import ChatOpenAI
|
49 |
+
#from langchain_openai import ChatOpenAI
|
50 |
+
from langchain_community.tools import Tool
|
51 |
+
|
52 |
import time
|
53 |
|
54 |
load_dotenv()
|
|
|
447 |
# -------------------------------
|
448 |
# Step 6: Create LangChain Tools
|
449 |
# -------------------------------
|
|
|
450 |
calc_tool = calculator
|
451 |
file_tool = analyze_attachment
|
452 |
web_tool = web_search
|
453 |
+
wiki_tool = wiki_search
|
454 |
arvix_tool = arvix_search
|
455 |
youtube_tool = get_youtube_transcript
|
456 |
video_tool = extract_video_id
|