Base Source¶
- class agent.browsing.manual.sources.base.ManualSource(*args, **kwargs)[source]¶
Bases:
Protocol
Protocol for manual browsing sources.
Implementations should be stateless or manage their own lightweight state.
- iter_all(query, chunk_size=100, limit=None, **kwargs)[source]¶
Iterate over results by fetching in chunks.
- search(query, max_results=25, start=0, **kwargs)[source]¶
Return a single page of results for a query.
- class agent.browsing.manual.sources.base.SearchItem(title, url, snippet=None, item_id=None, extra=None)[source]¶
Bases:
object
Lightweight search result item for manual browsing.
- Variables:
title – Human-readable title of the item.
url – Canonical URL for the item.
snippet – Optional short snippet or summary.
item_id – Optional stable identifier when available, e.g., a PubMed ID.
extra – Optional provider-specific metadata.
- Parameters:
- agent.browsing.manual.sources.base.paginate_results(results, limit)[source]¶
Yield up to a limit of results from an iterable.
- Parameters:
results (
Iterable
[SearchItem
]) – Iterable of search items to paginate.limit (
Optional
[int
]) – Optional maximum number of items to yield.
- Return type:
- Returns:
Iterator yielding up to
limit
items.