Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const DEFAULT_MAX_CHARACTERS = 10_000;
* @property {SummaryContentsOptions | boolean} [summary] - Options for retrieving summary.
* @property {LivecrawlOptions} [livecrawl] - Options for livecrawling contents. Default is "never" for neural/auto search, "fallback" for keyword search.
* @property {number} [livecrawlTimeout] - The timeout for livecrawling. Max and default is 10000ms.
* @property {number} [maxCacheAge] - Maximum age of cached content (in hours) before triggering a live crawl. Default is 168 (7 days).
* @property {boolean} [filterEmptyResults] - If true, filters out results with no contents. Default is true.
* @property {number} [subpages] - The number of subpages to return for each result, where each subpage is derived from an internal link for the result.
* @property {string | string[]} [subpageTarget] - Text used to match/rank subpages in the returned subpage list. You could use "about" to get *about* page for websites. Note that this is a fuzzy matcher.
Expand All @@ -34,6 +35,7 @@ export type ContentsOptions = {
livecrawl?: LivecrawlOptions;
context?: ContextOptions | true;
livecrawlTimeout?: number;
maxCacheAge?: number;
filterEmptyResults?: boolean;
subpages?: number;
subpageTarget?: string | string[];
Expand Down Expand Up @@ -470,6 +472,7 @@ export class Exa {
extras,
livecrawl,
livecrawlTimeout,
maxCacheAge,
context,
...rest
} = options;
Expand Down Expand Up @@ -512,6 +515,7 @@ export class Exa {
if (livecrawl !== undefined) contentsOptions.livecrawl = livecrawl;
if (livecrawlTimeout !== undefined)
contentsOptions.livecrawlTimeout = livecrawlTimeout;
if (maxCacheAge !== undefined) contentsOptions.maxCacheAge = maxCacheAge;
if (context !== undefined) contentsOptions.context = context;

return {
Expand Down