aboutsummaryrefslogtreecommitdiffstats
path: root/devourer.py
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-04-15 07:08:43 +0000
committerterminaldweller <thabogre@gmail.com>2022-04-15 07:08:43 +0000
commite4fbf25f654a27941ae0a12e7964443e30b5c45f (patch)
tree9208cea3dbcff44df5689c78ff5add98ca6f4841 /devourer.py
parentwip (diff)
downloaddevourer-e4fbf25f654a27941ae0a12e7964443e30b5c45f.tar.gz
devourer-e4fbf25f654a27941ae0a12e7964443e30b5c45f.zip
update
Diffstat (limited to 'devourer.py')
-rw-r--r--devourer.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/devourer.py b/devourer.py
index b0ce45a..936cf6e 100644
--- a/devourer.py
+++ b/devourer.py
@@ -1,6 +1,7 @@
# _*_ coding=utf-8 _*_
import bs4
+import concurrent.futures
import contextlib
import datetime
import fastapi
@@ -272,7 +273,7 @@ def getAudioFromFile(audio_path: str) -> str:
return audio.read()
-def getSentiments() -> list:
+def getSentiments(detailed: bool) -> list:
"""Get sentiments"""
results = list()
SOURCE = "https://github.com/coinpride/CryptoList"
@@ -388,15 +389,15 @@ def mila_ep(url: str, summary: str = "newspaper", audio: bool = False):
@app.get("/mila/sentiments")
-def sentiments_endpoint(url: str):
+def sentiments_endpoint(url: str, detailed: bool):
"""the sentiments endpoint"""
- sentiments = getSentiments()
+ sentiments = getSentiments(detailed)
return {"Content-Type": "application/json", "Sentiments": sentiments}
@app.get("/mila/health")
def health_ep():
- return {"isOK": True}
+ return {"Content-Type": "application/json", "isOK": True}
@app.get("/mila/robots.txt")