Skip to content

API Reference parrot_tools.rss.models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.rss.models

View source

Pydantic models and internal data structures for the RSS Feed Reader Toolkit.

Class FeedItemMetadata

LLM-facing record for a retrieved feed item.

This is the ONLY thing returned to the LLM by read_feeds — it carries metadata plus the paths of the archived content, never the content itself.

Fields:

Field Type Default Description
item_id str Stable id (sha256(link)[:16]) usable with get_content.
feed str Slug of the feed the item came from.
feed_url str URL of the feed the item came from.
title str '' Item title.
link str '' Article URL.
published Optional[str] None Publication timestamp (ISO-8601) when available.
summary Optional[str] None Feed-provided summary, truncated to 500 chars.
author Optional[str] None Item author when available.
html_path Optional[str] None Absolute path of the saved raw HTML page.
text_path Optional[str] None Absolute path of the saved extracted text.
fetch_method Literal['aiohttp', 'selenium', 'none'] 'none' How the page was retrieved.
fetch_status Literal['fetched', 'cached', 'failed'] 'failed' Outcome of the retrieval.
error Optional[str] None Error detail when the fetch failed or degraded.

Method FeedItemMetadata.to_llm_dict

Serialize for the LLM, dropping empty fields to save tokens.

to_llm_dict() -> Dict[str, Any]

Returns: Dict[str, Any]

Class FeedSite

A configured RSS/Atom feed source.

Fields:

Field Type Default Description
url str Feed URL (RSS or Atom XML endpoint).
name Optional[str] None Optional human-friendly name; used to derive the storage slug.
max_items Optional[int] None Optional per-site cap on items processed per read.
use_browser bool False When True, article pages for this site are always fetched with the Selenium browser instead of aiohttp.

Attributes:

Attribute Type Description
slug str Filesystem-safe identifier for this feed (name or URL host+path).

Method FeedSite.from_config

Coerce a feed configuration entry into a :class:FeedSite.

from_config(item: Union[str, Dict[str, Any], 'FeedSite']) -> 'FeedSite'

Parameter Type Default Description
item Union[str, Dict[str, Any], 'FeedSite'] A plain URL string, a dict of FeedSite fields, or an already-built FeedSite.

Returns: 'FeedSite' — A FeedSite instance.

Raises:

  • TypeError — If the entry is not a supported type.

Class FetchedPage

Internal result of a single article-page fetch attempt.

Parameter Type Default Description
html str ''
text str ''
method Literal['aiohttp', 'selenium', 'none'] 'none'
status_code Optional[int] None
error Optional[str] None
thin bool False

Fields:

Field Type Default Description
html str '' Raw page HTML ('' when nothing was retrieved).
text str '' Extracted main text ('' when extraction produced nothing).
method Literal['aiohttp', 'selenium', 'none'] 'none' Mechanism that produced the html.
status_code Optional[int] None HTTP status code (aiohttp path only).
error Optional[str] None Error message when the fetch failed or degraded.
thin bool False True when the extracted text is below the minimum length.

Class GetContentInput

Input schema for rss_get_content.

Fields:

Field Type Default Description
item str Item to read: either the 16-char item_id returned by rss_read_feeds, or a saved html_path/text_path
format Literal['text', 'html'] 'text' Which archived representation to return
max_chars int 20000 Maximum number of characters to return

Attribute MAX_SLUG_LENGTH

Attribute SUMMARY_MAX_CHARS

Function is_item_id

Check whether a string looks like an item id produced by :func:make_item_id.

is_item_id(value: str) -> bool

Parameter Type Default Description
value str Candidate string.

Returns: bool — True when the value is exactly 16 lowercase hex characters.

Function make_item_id

Derive a stable item identifier from an article link.

make_item_id(link: str) -> str

Parameter Type Default Description
link str Article URL as found in the feed entry.

Returns: str — First 16 hex chars of the SHA-256 digest of the link.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally