Spaces:
Runtime error
Runtime error
Update tools.py
Browse filescorrection another error indentation
tools.py
CHANGED
|
@@ -36,21 +36,21 @@ def summarize_text(text: str, max_length: int = 150) -> str:
|
|
| 36 |
|
| 37 |
@tool
|
| 38 |
def duckduckgo_search(query: str, max_results: int = 3) -> str:
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
results_texts = []
|
| 55 |
retry_attempts = 2
|
| 56 |
delay_seconds = 5
|
|
|
|
| 36 |
|
| 37 |
@tool
|
| 38 |
def duckduckgo_search(query: str, max_results: int = 3) -> str:
|
| 39 |
+
def duckduckgo_search(query: str, max_results: int = 3) -> str:
|
| 40 |
+
"""
|
| 41 |
+
Performs a search on DuckDuckGo and returns the results.
|
| 42 |
|
| 43 |
+
Args:
|
| 44 |
+
query (str): The search query.
|
| 45 |
+
max_results (int, optional): Maximum number of results to return. Defaults to 3.
|
| 46 |
|
| 47 |
+
Returns:
|
| 48 |
+
str: A formatted string containing the search results.
|
| 49 |
|
| 50 |
+
Raises:
|
| 51 |
+
[Insert any exceptions the function might raise, if applicable]
|
| 52 |
+
"""
|
| 53 |
+
|
| 54 |
results_texts = []
|
| 55 |
retry_attempts = 2
|
| 56 |
delay_seconds = 5
|