From e4fbf25f654a27941ae0a12e7964443e30b5c45f Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Fri, 15 Apr 2022 11:38:43 +0430 Subject: update --- devourer.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'devourer.py') 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") -- cgit v1.2.3