feat: add freshrss openclaw pipeline and clean repo
This commit is contained in:
@@ -6,14 +6,24 @@ from summary_mcp.core.errors import SummaryError
|
||||
from summary_mcp.models.summary_io import ExtractionInput
|
||||
|
||||
|
||||
MIN_INLINE_CONTENT_LENGTH = 500
|
||||
|
||||
|
||||
def _has_usable_content(value: str | None) -> bool:
|
||||
return bool(value and len(value.strip()) >= MIN_INLINE_CONTENT_LENGTH)
|
||||
|
||||
|
||||
def choose_inline_content(extraction_input: ExtractionInput) -> tuple[str | None, str]:
|
||||
if extraction_input.raw_html:
|
||||
return extraction_input.raw_html, "raw_html"
|
||||
|
||||
if extraction_input.item and extraction_input.item.raw_content and len(extraction_input.item.raw_content.strip()) >= 500:
|
||||
if extraction_input.item and _has_usable_content(extraction_input.item.raw_content):
|
||||
return extraction_input.item.raw_content, "item.raw_content"
|
||||
|
||||
if extraction_input.rss_content and len(extraction_input.rss_content.strip()) >= 500:
|
||||
if extraction_input.item and _has_usable_content(extraction_input.item.raw_summary):
|
||||
return extraction_input.item.raw_summary, "item.raw_summary"
|
||||
|
||||
if _has_usable_content(extraction_input.rss_content):
|
||||
return extraction_input.rss_content, "rss_content"
|
||||
|
||||
return None, "none"
|
||||
|
||||
Reference in New Issue
Block a user