/** * Perplexity direct HTTP transport. * * Two endpoints: * - POST /search — dedicated Search API (ranked results with snippets + dates) * - POST /v1/agent — Agent API (research via the "high" preset; replaces * the Sonar chat-completions surface sunset on 2026-09-27, #107) */ import type { ProviderQuotaFetchResponse } from "../types.js"; export interface PerplexityTransportDeps { readonly fetch?: (input: string, init: Record) => Promise; readonly setTimeout?: typeof setTimeout; readonly clearTimeout?: typeof clearTimeout; readonly env?: NodeJS.ProcessEnv; } export interface PerplexitySearchResultItem { readonly title?: string; readonly url?: string; readonly snippet?: string; readonly date?: string | null; readonly last_updated?: string | null; } export interface PerplexitySearchResponse { readonly id?: string; readonly results?: readonly PerplexitySearchResultItem[]; readonly server_time?: string | null; } export interface PerplexitySearchParams { readonly max_results?: number; readonly search_context_size?: "low" | "medium" | "high"; readonly search_domain_filter?: readonly string[]; readonly search_recency_filter?: "hour" | "day" | "week" | "month" | "year"; } /** One ranked source inside a `search_results` output item. */ export interface PerplexityAgentSearchResult { readonly id?: number; readonly title?: string; readonly url?: string; readonly date?: string | null; readonly last_updated?: string | null; readonly snippet?: string; readonly source?: string; } /** * One typed item of the Agent API `output[]` trace. `search_results` * items carry `results[]` (the sources of one search round); `message` * items carry `content[]` (the answer text as `output_text` parts). */ export interface PerplexityAgentOutputItem { readonly type?: string; readonly results?: readonly PerplexityAgentSearchResult[]; readonly content?: readonly { readonly type?: string; readonly text?: string; }[]; } export interface PerplexityAgentResponse { readonly id?: string; readonly model?: string; readonly status?: string; readonly error?: unknown; readonly output?: readonly PerplexityAgentOutputItem[]; } export declare function resolveTimeoutMs(env: NodeJS.ProcessEnv): number; export declare function resolveResearchTimeoutMs(env: NodeJS.ProcessEnv): number; export declare function fetchPerplexitySearch(apiKey: string, query: string, params?: PerplexitySearchParams, deps?: PerplexityTransportDeps): Promise; export declare function fetchPerplexityAgent(apiKey: string, prompt: string, deps?: PerplexityTransportDeps, externalSignal?: AbortSignal): Promise; //# sourceMappingURL=client.d.ts.map