Update app.py
Browse files
app.py
CHANGED
@@ -15,13 +15,23 @@ login(token=os.environ["HUGGINGFACEHUB_API_TOKEN"])
|
|
15 |
## TOOL 1
|
16 |
search_tool = DuckDuckGoSearchTool()
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
async def run_and_submit_all(profile: gr.OAuthProfile | None):
|
20 |
log_output = ""
|
21 |
|
22 |
try:
|
23 |
agent = ToolCallingAgent(
|
24 |
-
tools=[search_tool],
|
25 |
model=InferenceClientModel(model="deepseek-ai/DeepSeek-V3", provider="together"),
|
26 |
max_steps=15,
|
27 |
verbosity_level=0,
|
|
|
15 |
## TOOL 1
|
16 |
search_tool = DuckDuckGoSearchTool()
|
17 |
|
18 |
+
## TOOL 2
|
19 |
+
class WikipediaTool(Tool):
|
20 |
+
name = "wikipedia_search"
|
21 |
+
description = "Search Wikipedia and extract summaries"
|
22 |
+
inputs = {"query": "string"}
|
23 |
+
output_type = "string"
|
24 |
+
|
25 |
+
def forward(self, query):
|
26 |
+
return some_wikipedia_search_logic(query)
|
27 |
+
wiki_tool = WikipediaTool()
|
28 |
|
29 |
async def run_and_submit_all(profile: gr.OAuthProfile | None):
|
30 |
log_output = ""
|
31 |
|
32 |
try:
|
33 |
agent = ToolCallingAgent(
|
34 |
+
tools=[search_tool, wiki_tool],
|
35 |
model=InferenceClientModel(model="deepseek-ai/DeepSeek-V3", provider="together"),
|
36 |
max_steps=15,
|
37 |
verbosity_level=0,
|