type TavilySearchFuncton = (query: string, options?: TavilySearchOptions) => Promise; /** * @deprecated This function is deprecated and will be removed in a future version. * Use `search()` with `includeAnswer: true` instead, which returns the answer in the response. */ type TavilyQNASearchFuncton = (query: string, options: TavilySearchOptions) => Promise; /** * @deprecated This function is deprecated and will be removed in a future version. * Use `search()` directly and process the results as needed. */ type TavilyContextSearchFuncton = (query: string, options: TavilySearchOptions) => Promise; type TavilyExtractFunction = (urls: Array, options?: TavilyExtractOptions) => Promise; type TavilyCrawlFunction = (url: string, options?: TavilyCrawlOptions) => Promise; type TavilyMapFunction = (url: string, options?: TavilyMapOptions) => Promise; type TavilyResearchFunction = (input: string, options?: TavilyResearchOptions) => Promise>; type TavilyGetResearchFunction = (requestId: string) => Promise; type TavilyClient = { search: TavilySearchFuncton; /** @deprecated Use `search()` with `includeAnswer: true` instead */ searchQNA: TavilyQNASearchFuncton; /** @deprecated Use `search()` directly and process results as needed */ searchContext: TavilyContextSearchFuncton; extract: TavilyExtractFunction; crawl: TavilyCrawlFunction; map: TavilyMapFunction; research: TavilyResearchFunction; getResearch: TavilyGetResearchFunction; }; type TavilyProxyOptions = { http?: string; https?: string; }; type TavilyClientOptions = { apiKey?: string; proxies?: TavilyProxyOptions; apiBaseURL?: string; clientSource?: string; projectId?: string; sessionId?: string; humanId?: string; clientName?: string; }; type TavilyRequestConfig = { apiKey: string; proxies?: TavilyProxyOptions; apiBaseURL?: string; clientSource?: string; projectId?: string; sessionId?: string; humanId?: string; clientName?: string; }; type TavilySearchOptions = { searchDepth?: "basic" | "advanced" | "fast" | "ultra-fast"; topic?: "general" | "news" | "finance"; days?: number; maxResults?: number; includeImages?: boolean; includeImageDescriptions?: boolean; includeAnswer?: boolean | "basic" | "advanced"; includeRawContent?: false | "markdown" | "text"; includeDomains?: string[]; excludeDomains?: string[]; maxTokens?: number; timeRange?: "year" | "month" | "week" | "day" | "y" | "m" | "w" | "d"; chunksPerSource?: number; country?: string; startDate?: string; endDate?: string; autoParameters?: boolean; timeout?: number; includeFavicon?: boolean; includeUsage?: boolean; exactMatch?: boolean; sessionId?: string; humanId?: string; clientName?: string; [key: string]: any; }; type TavilyImage = { url: string; description?: string; }; type TavilySearchResult = { title: string; url: string; content: string; rawContent?: string; score: number; publishedDate: string; favicon?: string; }; type TavilySearchResponse = { answer?: string; query: string; responseTime: number; images: Array; results: Array; autoParameters?: Partial; favicon?: string; usage?: { credits: number; }; requestId: string; }; type TavilyExtractOptions = { includeImages?: boolean; extractDepth?: "basic" | "advanced"; format?: "markdown" | "text"; timeout?: number; includeFavicon?: boolean; includeUsage?: boolean; query?: string; chunksPerSource?: number; sessionId?: string; humanId?: string; clientName?: string; [key: string]: any; }; type TavilyExtractResult = { url: string; title: string | null; rawContent: string; images?: Array; favicon?: string; }; type TavilyExtractFailedResult = { url: string; error: string; }; type TavilyExtractResponse = { results: Array; failedResults: Array; responseTime: number; usage?: { credits: number; }; requestId: string; }; type TavilyCrawlOptions = { maxDepth?: number; maxBreadth?: number; limit?: number; instructions?: string; extractDepth?: "basic" | "advanced"; selectPaths?: string[]; selectDomains?: string[]; excludePaths?: string[]; excludeDomains?: string[]; allowExternal?: boolean; includeImages?: boolean; format?: "markdown" | "text"; timeout?: number; includeFavicon?: boolean; includeUsage?: boolean; chunksPerSource?: number; sessionId?: string; humanId?: string; clientName?: string; [key: string]: any; }; type TavilyCrawlResponse = { responseTime: number; baseUrl: string; results: Array<{ url: string; rawContent: string; images: Array; favicon?: string; }>; usage?: { credits: number; }; requestId: string; }; type TavilyMapOptions = { limit?: number; maxDepth?: number; maxBreadth?: number; selectPaths?: string[]; selectDomains?: string[]; excludePaths?: string[]; excludeDomains?: string[]; allowExternal?: boolean; instructions?: string; timeout?: number; includeUsage?: boolean; sessionId?: string; humanId?: string; clientName?: string; [key: string]: any; }; type TavilyMapResponse = { responseTime: number; baseUrl: string; results: string[]; usage?: { credits: number; }; requestId: string; }; type TavilyResearchOptions = { model?: "mini" | "pro" | "auto"; outputSchema?: Record; stream?: boolean; citationFormat?: "numbered" | "mla" | "apa" | "chicago"; timeout?: number; sessionId?: string; humanId?: string; clientName?: string; [key: string]: any; }; type TavilyResearchResponse = { requestId: string; createdAt: string; status: string; input: string; model: string; responseTime: number; }; type TavilyGetResearchResponse = { requestId: string; createdAt: string; status: string; content: string | Record; sources: Array<{ title: string; url: string; }>; responseTime: number; }; type TavilyGetResearchIncompleteStatusResponse = Pick; declare function tavily(options?: TavilyClientOptions): TavilyClient; export { type TavilyClient, type TavilyClientOptions, type TavilyContextSearchFuncton, type TavilyCrawlFunction, type TavilyCrawlOptions, type TavilyCrawlResponse, type TavilyExtractFunction, type TavilyExtractOptions, type TavilyExtractResponse, type TavilyGetResearchFunction, type TavilyGetResearchIncompleteStatusResponse, type TavilyGetResearchResponse, type TavilyMapFunction, type TavilyMapOptions, type TavilyMapResponse, type TavilyProxyOptions, type TavilyQNASearchFuncton, type TavilyRequestConfig, type TavilyResearchFunction, type TavilyResearchOptions, type TavilyResearchResponse, type TavilySearchFuncton, type TavilySearchOptions, type TavilySearchResponse, tavily };