Adds plugins/web/perplexity — a keyed-only WebSearchProvider over httpx: - search: POST https://api.perplexity.ai/search (documented Search API), search_context_size=low so `snippet` stays description-sized; results[].snippet -> description, max_results capped at the API's 20. - extract: POST /sdk/content/snippets — the query-relevant page-excerpt route behind `pplx content snippets` (the CLI's `content fetch` is deprecated upstream). web_extract has no query, so the URLs' path words serve as the relevance query; per-URL `error` entries survive a 200. - Wired into the same touchpoints as the other keyed vendors: legacy backend set + credential ladder + availability probe (web_tools), registry preference walk, OPTIONAL_ENV_VARS, `hermes config`/status/ dump key lists, nous_subscription direct-credential detection, setup summary, test conftests, docs. Not a keyless-ring member (Perplexity has no anonymous tier). Related closed PRs #9192 / #23981 / #45225 predate the plugin ABC.
16 lines
514 B
Python
16 lines
514 B
Python
"""Perplexity web search + snippets plugin — bundled, auto-loaded.
|
|
|
|
Backed by the Perplexity Search API over httpx. Both search and extract are
|
|
sync; the dispatcher in :mod:`tools.web_tools` handles the wrap when the
|
|
caller is async.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from plugins.web.perplexity.provider import PerplexityWebSearchProvider
|
|
|
|
|
|
def register(ctx) -> None:
|
|
"""Register the Perplexity provider with the plugin context."""
|
|
ctx.register_web_search_provider(PerplexityWebSearchProvider())
|