File size: 336 Bytes
894c2eb
5f5b92b
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
from backend import run_llm

def summarize_text(text: str, max_len: int = 500) -> str:
    """Summarize a block of text/logs with LLM backend"""
    if not text.strip():
        return "⚠️ No content to summarize."
    prompt = f"Summarize the following text in plain English:\n\n{text[:2000]}"
    return run_llm(prompt)[:max_len]