Spaces:
Running
Running
Update routers/analyze.py
Browse files- routers/analyze.py +3 -3
routers/analyze.py
CHANGED
@@ -52,7 +52,7 @@ SUPABASE_ROLE_HEADERS = {
|
|
52 |
}
|
53 |
|
54 |
# Rewrite API URL
|
55 |
-
REWRITE_API_URL = "https://habulaj-newapi.hf.space/rewrite-news"
|
56 |
|
57 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
|
58 |
log = logging.getLogger("news-analyze-api")
|
@@ -400,13 +400,13 @@ async def fetch_wikipedia_info(entity_name: str) -> Optional[Dict[str, Any]]:
|
|
400 |
return None
|
401 |
|
402 |
def generate_poster_url(name: str, birth: int, death: int, image_url: str) -> str:
|
403 |
-
base_url = "https://habulaj-newapi.hf.space/cover/memoriam"
|
404 |
params = f"?image_url={quote(image_url)}&name={quote(name)}&birth={birth}&death={death}"
|
405 |
return base_url + params
|
406 |
|
407 |
def generate_news_poster_url(image_url: str, headline: str) -> str:
|
408 |
"""Gera URL do poster para notícias normais (não morte)"""
|
409 |
-
base_url = "https://habulaj-newapi.hf.space/cover/news"
|
410 |
params = f"?image_url={quote(image_url)}&headline={quote(headline)}"
|
411 |
return base_url + params
|
412 |
|
|
|
52 |
}
|
53 |
|
54 |
# Rewrite API URL
|
55 |
+
REWRITE_API_URL = "https://habulaj-newapi-clone.hf.space/rewrite-news"
|
56 |
|
57 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
|
58 |
log = logging.getLogger("news-analyze-api")
|
|
|
400 |
return None
|
401 |
|
402 |
def generate_poster_url(name: str, birth: int, death: int, image_url: str) -> str:
|
403 |
+
base_url = "https://habulaj-newapi-clone.hf.space/cover/memoriam"
|
404 |
params = f"?image_url={quote(image_url)}&name={quote(name)}&birth={birth}&death={death}"
|
405 |
return base_url + params
|
406 |
|
407 |
def generate_news_poster_url(image_url: str, headline: str) -> str:
|
408 |
"""Gera URL do poster para notícias normais (não morte)"""
|
409 |
+
base_url = "https://habulaj-newapi-clone.hf.space/cover/news"
|
410 |
params = f"?image_url={quote(image_url)}&headline={quote(headline)}"
|
411 |
return base_url + params
|
412 |
|