Spaces:
Runtime error
Runtime error
File size: 342 Bytes
5f5b92b | 1 2 3 4 5 6 7 8 9 | from utils.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]
|