Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
-
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
from bs4 import BeautifulSoup
|
|
@@ -27,7 +26,7 @@ def scrape_drug_reviews_tool(drug_name: str, max_pages: int = 3) -> dict :
|
|
| 27 |
Output: a dictionary url:review mapping the url of a review to the text of the review
|
| 28 |
"""
|
| 29 |
try:
|
| 30 |
-
df =
|
| 31 |
return df.to_dict(orient="records")
|
| 32 |
except Exception as e:
|
| 33 |
return {"error": str(e)}
|
|
|
|
| 1 |
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
|
| 2 |
import datetime
|
| 3 |
import requests
|
|
|
|
| 4 |
import yaml
|
| 5 |
from tools.final_answer import FinalAnswerTool
|
| 6 |
from bs4 import BeautifulSoup
|
|
|
|
| 26 |
Output: a dictionary url:review mapping the url of a review to the text of the review
|
| 27 |
"""
|
| 28 |
try:
|
| 29 |
+
df = run(scrape_drugs_com_reviews_requests(drug_name, max_pages))
|
| 30 |
return df.to_dict(orient="records")
|
| 31 |
except Exception as e:
|
| 32 |
return {"error": str(e)}
|