Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import pandas as pd
|
|
| 6 |
|
| 7 |
# Import our custom tools from their modules
|
| 8 |
from huggingface_hub import login
|
| 9 |
-
from smolagents import CodeAgent, InferenceClientModel, OpenAIServerModel
|
| 10 |
from tools import web_search, visit_webpage, final_answer
|
| 11 |
# from tools import web_search, visit_webpage, final_answer, go_back, close_popups, search_item_ctrl_f
|
| 12 |
from retriever import load_guest_dataset
|
|
@@ -29,7 +29,7 @@ class BasicAgent:
|
|
| 29 |
login(token=api_key)
|
| 30 |
|
| 31 |
# Create the search tool
|
| 32 |
-
self.web_search = web_search
|
| 33 |
|
| 34 |
self.visit_webpage = visit_webpage
|
| 35 |
|
|
@@ -51,7 +51,7 @@ class BasicAgent:
|
|
| 51 |
|
| 52 |
# Create the agent with tools
|
| 53 |
self.agent = CodeAgent(
|
| 54 |
-
tools=[
|
| 55 |
# tools=[self.web_search, self.visit_webpage, self.final_answer, go_back, close_popups, search_item_ctrl_f],
|
| 56 |
model=self.model,
|
| 57 |
additional_authorized_imports=["pandas", "openpyxl", "yt_dlp", "requests", "io", "json", "whisper", "bs4"],
|
|
|
|
| 6 |
|
| 7 |
# Import our custom tools from their modules
|
| 8 |
from huggingface_hub import login
|
| 9 |
+
from smolagents import CodeAgent, InferenceClientModel, OpenAIServerModel, GoogleSearchTool
|
| 10 |
from tools import web_search, visit_webpage, final_answer
|
| 11 |
# from tools import web_search, visit_webpage, final_answer, go_back, close_popups, search_item_ctrl_f
|
| 12 |
from retriever import load_guest_dataset
|
|
|
|
| 29 |
login(token=api_key)
|
| 30 |
|
| 31 |
# Create the search tool
|
| 32 |
+
# self.web_search = web_search
|
| 33 |
|
| 34 |
self.visit_webpage = visit_webpage
|
| 35 |
|
|
|
|
| 51 |
|
| 52 |
# Create the agent with tools
|
| 53 |
self.agent = CodeAgent(
|
| 54 |
+
tools=[GoogleSearchTool(), self.visit_webpage, self.final_answer],
|
| 55 |
# tools=[self.web_search, self.visit_webpage, self.final_answer, go_back, close_popups, search_item_ctrl_f],
|
| 56 |
model=self.model,
|
| 57 |
additional_authorized_imports=["pandas", "openpyxl", "yt_dlp", "requests", "io", "json", "whisper", "bs4"],
|