Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
-
from smolagents import DuckDuckGoSearchTool
|
| 7 |
from tools import hub_stats_tool
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
|
@@ -27,7 +27,7 @@ class NewAgent:
|
|
| 27 |
|
| 28 |
|
| 29 |
# Initialize the web search tool
|
| 30 |
-
search_tool = DuckDuckGoSearchTool()
|
| 31 |
# Initialize the Hub stats tool
|
| 32 |
hub_stats_tool = HubStatsTool()
|
| 33 |
# Generate the chat interface, including the tools
|
|
@@ -36,9 +36,11 @@ class NewAgent:
|
|
| 36 |
huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
|
| 37 |
)
|
| 38 |
chat = ChatHuggingFace(llm=llm, verbose=True)
|
| 39 |
-
tools = [
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
| 42 |
chat_with_tools = chat.bind_tools(tools)
|
| 43 |
# Generate the AgentState and Agent graph
|
| 44 |
class AgentState(TypedDict):
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
+
# from smolagents import DuckDuckGoSearchTool
|
| 7 |
from tools import hub_stats_tool
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
# Initialize the web search tool
|
| 30 |
+
# search_tool = DuckDuckGoSearchTool()
|
| 31 |
# Initialize the Hub stats tool
|
| 32 |
hub_stats_tool = HubStatsTool()
|
| 33 |
# Generate the chat interface, including the tools
|
|
|
|
| 36 |
huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
|
| 37 |
)
|
| 38 |
chat = ChatHuggingFace(llm=llm, verbose=True)
|
| 39 |
+
tools = [
|
| 40 |
+
# search_tool,
|
| 41 |
+
# weather_info_tool,
|
| 42 |
+
hub_stats_tool,
|
| 43 |
+
]
|
| 44 |
chat_with_tools = chat.bind_tools(tools)
|
| 45 |
# Generate the AgentState and Agent graph
|
| 46 |
class AgentState(TypedDict):
|