Spaces:
Runtime error
Runtime error
Ashhar
commited on
Commit
·
19598a5
1
Parent(s):
31571b9
extra logging
Browse files- tools/tools.py +4 -1
tools/tools.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
|
| 2 |
import tools.webScraper as WS
|
| 3 |
import time
|
|
|
|
| 4 |
|
| 5 |
from dotenv import load_dotenv
|
| 6 |
load_dotenv()
|
|
@@ -13,10 +14,12 @@ def getGoogleSearchResults(query: str):
|
|
| 13 |
else:
|
| 14 |
results = ""
|
| 15 |
timeTaken = time.time() - startTime
|
|
|
|
|
|
|
| 16 |
return {
|
| 17 |
"response": results,
|
| 18 |
"display": {
|
| 19 |
-
"text":
|
| 20 |
"icon": "icons/google_search.png",
|
| 21 |
}
|
| 22 |
}
|
|
|
|
| 1 |
|
| 2 |
import tools.webScraper as WS
|
| 3 |
import time
|
| 4 |
+
import utils as U
|
| 5 |
|
| 6 |
from dotenv import load_dotenv
|
| 7 |
load_dotenv()
|
|
|
|
| 14 |
else:
|
| 15 |
results = ""
|
| 16 |
timeTaken = time.time() - startTime
|
| 17 |
+
displayText = f"Searched Google [{round(timeTaken * 1000)} ms]"
|
| 18 |
+
U.pprint(displayText)
|
| 19 |
return {
|
| 20 |
"response": results,
|
| 21 |
"display": {
|
| 22 |
+
"text": displayText,
|
| 23 |
"icon": "icons/google_search.png",
|
| 24 |
}
|
| 25 |
}
|