mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-08 22:22:17 +02:00
- Added a new `reddit` subagent to scrape structured data from Reddit posts, comments, and users. - Introduced `reddit.scrape` capability for fetching data using URLs and search queries. - Implemented tools for scraping and parsing Reddit data, including handling pagination and rate limits. - Created input/output models for the Reddit scraper to define request and response structures. - Added documentation for the new Reddit scraping functionality and its usage. - Integrated the Reddit subagent into the existing multi-agent chat framework.
24 lines
995 B
Python
24 lines
995 B
Python
"""``reddit.scrape`` capability registration (free — see 04-capabilities open item)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from app.capabilities.core import Capability, register_capability
|
|
from app.capabilities.reddit.scrape.executor import build_scrape_executor
|
|
from app.capabilities.reddit.scrape.schemas import ScrapeInput, ScrapeOutput
|
|
|
|
REDDIT_SCRAPE = Capability(
|
|
name="reddit.scrape",
|
|
description=(
|
|
"Scrape public Reddit data. Give it Reddit URLs (post, subreddit, or "
|
|
"user) and/or search terms, and it returns structured items — posts "
|
|
"(title, body, score, comment count, subreddit, author), their comments, "
|
|
"and community/user metadata. Use search_queries (optionally scoped to a "
|
|
"community) to discover posts, or urls to pull a known post/subreddit/user."
|
|
),
|
|
input_schema=ScrapeInput,
|
|
output_schema=ScrapeOutput,
|
|
executor=build_scrape_executor(),
|
|
billing_unit=None,
|
|
)
|
|
|
|
register_capability(REDDIT_SCRAPE)
|