File size: 601 Bytes
08b5d1c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import requests

def summarize_via_hf(text: str):
    """
    Отправляет текст в Eroha Summarizer PRO (на Hugging Face)
    и возвращает краткое резюме.
    """
    url = "https://yermek68-eroha-agentapi.hf.space/api/summarize"
    try:
        response = requests.post(url, json={"text": text}, timeout=30)
        if response.status_code == 200:
            return response.json().get("summary", "")
        else:
            return f"Ошибка: {response.status_code}"
    except Exception as e:
        return f"Ошибка соединения: {e}"