import { ProviderV4, LanguageModelV4 } from '@ai-sdk/provider'; import { FetchFunction } from '@ai-sdk/provider-utils'; import { z } from 'zod/v4'; type PerplexityLanguageModelId = 'sonar-deep-research' | 'sonar-reasoning-pro' | 'sonar-reasoning' | 'sonar-pro' | 'sonar' | (string & {}); interface PerplexityProvider extends ProviderV4 { /** * Creates an Perplexity chat model for text generation. */ (modelId: PerplexityLanguageModelId): LanguageModelV4; /** * Creates an Perplexity language model for text generation. */ languageModel(modelId: PerplexityLanguageModelId): LanguageModelV4; /** * @deprecated Use `embeddingModel` instead. */ textEmbeddingModel(modelId: string): never; } interface PerplexityProviderSettings { /** * Base URL for the perplexity API calls. */ baseURL?: string; /** * API key for authenticating requests. */ apiKey?: string; /** * Custom headers to include in the requests. */ headers?: Record; /** * Custom fetch implementation. You can use it as a middleware to intercept requests, * or to provide a custom fetch implementation for e.g. testing. */ fetch?: FetchFunction; } declare function createPerplexity(options?: PerplexityProviderSettings): PerplexityProvider; declare const perplexity: PerplexityProvider; declare const perplexityLanguageModelOptions: z.ZodObject<{ /** * Filters search results to those published within the specified time window. * Cannot be combined with other date filters. */ search_recency_filter: z.ZodOptional>; /** * Restrict web search results to specific domains or URLs. * Prefix a domain with "-" to exclude it. */ search_domain_filter: z.ZodOptional>; /** * Filter search results by language using ISO 639-1 codes. */ search_language_filter: z.ZodOptional>; /** * Return search results published after this date. */ search_after_date_filter: z.ZodOptional; /** * Return search results published before this date. */ search_before_date_filter: z.ZodOptional; /** * Return search results last updated after this date. */ last_updated_after_filter: z.ZodOptional; /** * Return search results last updated before this date. */ last_updated_before_filter: z.ZodOptional; /** * Source of search results. */ search_mode: z.ZodOptional>; /** * If true, the model decides whether web search is needed. */ enable_search_classifier: z.ZodOptional; /** * If true, disables web search. */ disable_search: z.ZodOptional; /** * If true, a list of related questions is included in the response. */ return_related_questions: z.ZodOptional; /** * If true, image search results are included in the response. */ return_images: z.ZodOptional; /** * Restrict image results to specific domains. * Prefix a domain with "-" to exclude it. */ image_domain_filter: z.ZodOptional>; /** * Restrict image results to specific file formats. */ image_format_filter: z.ZodOptional>; /** * Additional media response configuration. */ media_response: z.ZodOptional; }, z.core.$loose>>; }, z.core.$loose>>; /** * Controls the format of streaming events. */ stream_mode: z.ZodOptional>; /** * Controls how much effort the model spends on reasoning. */ reasoning_effort: z.ZodOptional>; /** * Preferred response language as an ISO 639-1 language code. */ language_preference: z.ZodOptional; /** * Additional web search configuration. */ web_search_options: z.ZodOptional>; /** * Controls whether to use fast search, pro search, or automatic routing. */ search_type: z.ZodOptional>; /** * User location for search result personalization. */ user_location: z.ZodOptional; longitude: z.ZodOptional; country: z.ZodOptional; city: z.ZodOptional; region: z.ZodOptional; }, z.core.$loose>>; /** * If true, applies enhanced relevance filtering to image results. */ image_results_enhanced_relevance: z.ZodOptional; }, z.core.$loose>>; }, z.core.$loose>; type PerplexityLanguageModelOptions = z.infer; declare const VERSION: string; export { type PerplexityLanguageModelOptions, type PerplexityProvider, type PerplexityProviderSettings, VERSION, createPerplexity, perplexity };