Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,10 +35,10 @@ def answer_nfl_question_tool(question: str ) -> str:
|
|
| 35 |
"""
|
| 36 |
|
| 37 |
# Prepare the duckduckgo query
|
| 38 |
-
|
| 39 |
-
print(f"🔍 Searching DuckDuckGo with query: {
|
| 40 |
with DDGS() as ddgs:
|
| 41 |
-
search_results = list(ddgs.text(
|
| 42 |
|
| 43 |
print(f"📊 Found {len(search_results)} results") # Debug
|
| 44 |
|
|
@@ -62,7 +62,7 @@ def answer_nfl_question_tool(question: str ) -> str:
|
|
| 62 |
|
| 63 |
visit_webpage_tool = VisitWebpageTool()
|
| 64 |
|
| 65 |
-
for i, url in enumerate(urls[:
|
| 66 |
try:
|
| 67 |
page_content = visit_webpage_tool.forward(url)
|
| 68 |
detailed_results.append(f"\nSource {i}: {url}\n")
|
|
|
|
| 35 |
"""
|
| 36 |
|
| 37 |
# Prepare the duckduckgo query
|
| 38 |
+
search_query = f"{question}"
|
| 39 |
+
print(f"🔍 Searching DuckDuckGo with query: {search_query}") # Debug
|
| 40 |
with DDGS() as ddgs:
|
| 41 |
+
search_results = list(ddgs.text(search_query, max_results=3)) # Otteniamo i primi 5 risultati
|
| 42 |
|
| 43 |
print(f"📊 Found {len(search_results)} results") # Debug
|
| 44 |
|
|
|
|
| 62 |
|
| 63 |
visit_webpage_tool = VisitWebpageTool()
|
| 64 |
|
| 65 |
+
for i, url in enumerate(urls[:3], 1):
|
| 66 |
try:
|
| 67 |
page_content = visit_webpage_tool.forward(url)
|
| 68 |
detailed_results.append(f"\nSource {i}: {url}\n")
|