Spaces:
Sleeping
Sleeping
Update helper_functions_api.py
Browse files- helper_functions_api.py +4 -4
helper_functions_api.py
CHANGED
@@ -185,7 +185,7 @@ def rephrase_content(data_format, content, query):
|
|
185 |
)
|
186 |
|
187 |
@cache(expire=604800)
|
188 |
-
def fetch_content(url):
|
189 |
try:
|
190 |
response = hrequests.get(url)
|
191 |
if response.status_code == 200:
|
@@ -210,9 +210,9 @@ def extract_main_content(html):
|
|
210 |
else:
|
211 |
return ""
|
212 |
|
213 |
-
|
214 |
-
def process_content(data_format, url, query):
|
215 |
-
html_content =
|
216 |
if html_content:
|
217 |
content = extract_main_content(html_content)
|
218 |
if content:
|
|
|
185 |
)
|
186 |
|
187 |
@cache(expire=604800)
|
188 |
+
def async fetch_content(url):
|
189 |
try:
|
190 |
response = hrequests.get(url)
|
191 |
if response.status_code == 200:
|
|
|
210 |
else:
|
211 |
return ""
|
212 |
|
213 |
+
@cache(expire=604800)
|
214 |
+
def async process_content(data_format, url, query):
|
215 |
+
html_content = fetch_content(url)
|
216 |
if html_content:
|
217 |
content = extract_main_content(html_content)
|
218 |
if content:
|