/** * Perplexity Provider Adapter. * * Implements Search, Research, and Diagnostics capabilities for the * Perplexity API. * * Search uses the dedicated Search API (POST /search) which returns * structured results with titles, URLs, snippets, and dates — far richer * than mapping chat completions to citations. * * Research uses the Agent API (POST /v1/agent) with the `high` * preset — the official successor to `sonar-deep-research` on the * Sonar chat-completions endpoint (sunset 2026-09-27, #107). The * response carries an `output[]` trace: `message` items hold the * report text, `search_results` items hold structured sources * (title, url, date, snippet) — one item per search round. * * Reader is intentionally omitted: Perplexity does not offer a * dedicated webpage extraction API. * * Field mapping: * Search (/search): * results[].title -> title * results[].url -> url * results[].snippet -> summary * results[].date -> date * Research (/v1/agent, preset "high"): * output[].message.content[].text -> report * output[].search_results.results[] -> sources[] (union across * search rounds, deduped by URL, first occurrence wins) * * Control mapping (SearchControls → Search API params): * domain -> search_domain_filter: [domain] * recency -> search_recency_filter (oneDay→"day", oneWeek→"week", * oneMonth→"month", oneYear→"year", noLimit→omit) * contentSize -> search_context_size (medium→"medium", high→"high") * type -> REJECTED (UnsupportedOptionError) * location -> REJECTED (UnsupportedOptionError) * topic -> appended to query string via applySearchTopic */ import type { ProviderAdapter, ProviderContext, ProviderDescriptor, ProviderId } from "../types.js"; import type { SearchCapability } from "../../capabilities/search.js"; import type { ResearchCapability } from "../../capabilities/research.js"; import type { DiagnosticsCapability } from "../../capabilities/diagnostics.js"; import { type PerplexityTransportDeps } from "./client.js"; export interface PerplexityAdapterDependencies { readonly transport?: PerplexityTransportDeps; } export declare class PerplexityAdapter implements ProviderAdapter { private readonly context; readonly id: ProviderId; readonly search: SearchCapability; readonly research: ResearchCapability; readonly diagnostics: DiagnosticsCapability; constructor(context: ProviderContext, deps?: PerplexityAdapterDependencies); } export declare function createPerplexityDescriptor(): ProviderDescriptor; //# sourceMappingURL=adapter.d.ts.map