exa-js 2.18.1 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -0
- package/dist/index.d.mts +246 -8
- package/dist/index.d.ts +246 -8
- package/dist/index.js +481 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +471 -38
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -120,6 +120,70 @@ for await (const chunk of exa.streamAnswer("Explain quantum computing")) {
|
|
|
120
120
|
}
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
+
## Web Search and Contents tools
|
|
124
|
+
|
|
125
|
+
Use Exa as a `web_search` tool in an OpenAI or Anthropic loop. Call `webSearch()` with no arguments to get Exa's recommended settings for agentic search (`type: "auto"` and `contents: { highlights: true }`).
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
import Exa from "exa-js";
|
|
129
|
+
import { OpenAI } from "openai";
|
|
130
|
+
|
|
131
|
+
const exa = new Exa(process.env.EXA_API_KEY);
|
|
132
|
+
const openai = new OpenAI();
|
|
133
|
+
|
|
134
|
+
const messages = [{ role: "user", content: "What's the latest on AI chips?" }];
|
|
135
|
+
|
|
136
|
+
const completion = await openai.chat.completions.create({
|
|
137
|
+
model: "gpt-5.6",
|
|
138
|
+
messages,
|
|
139
|
+
tools: [exa.openai.webSearch()],
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const message = completion.choices[0].message;
|
|
143
|
+
messages.push(message, ...(await exa.openai.handleToolCalls(message)));
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
148
|
+
|
|
149
|
+
const anthropic = new Anthropic();
|
|
150
|
+
const response = await anthropic.messages.create({
|
|
151
|
+
model: "claude-sonnet-4-5",
|
|
152
|
+
max_tokens: 1024,
|
|
153
|
+
messages,
|
|
154
|
+
tools: [exa.anthropic.webSearch()],
|
|
155
|
+
});
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
For the OpenAI Responses API, use `exa.openai.responses.webSearch()` and the same `handleToolCalls` helper.
|
|
159
|
+
|
|
160
|
+
Pass `name` (and optionally `description`) to rename the tool — for example to run Exa alongside Anthropic's built-in `web_search_20250305` server tool, which reserves the `web_search` name:
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
const response = await anthropic.messages.create({
|
|
164
|
+
model: "claude-sonnet-4-5",
|
|
165
|
+
max_tokens: 1024,
|
|
166
|
+
messages,
|
|
167
|
+
tools: [
|
|
168
|
+
{ type: "web_search_20250305", name: "web_search", max_uses: 5 },
|
|
169
|
+
exa.anthropic.webSearch({ name: "exa_web_search" }),
|
|
170
|
+
],
|
|
171
|
+
});
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
`getContents()` is available in the same namespaces and lets the model read pages it already has URLs for. It takes a list of URLs and accepts every `exa.getContents` option:
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
const completion = await openai.chat.completions.create({
|
|
178
|
+
model: "gpt-5.6",
|
|
179
|
+
messages,
|
|
180
|
+
tools: [
|
|
181
|
+
exa.openai.webSearch(),
|
|
182
|
+
exa.openai.getContents({ summary: true, livecrawl: "preferred" }),
|
|
183
|
+
],
|
|
184
|
+
});
|
|
185
|
+
```
|
|
186
|
+
|
|
123
187
|
## Agent API
|
|
124
188
|
|
|
125
189
|
```ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ZodSchema } from 'zod';
|
|
1
|
+
import { ZodSchema, z } from 'zod';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Types for the Exa Agent API.
|
|
@@ -18,7 +18,7 @@ interface AgentBetaOptions {
|
|
|
18
18
|
betas?: string[];
|
|
19
19
|
}
|
|
20
20
|
type AgentRunStatus = "queued" | "running" | "completed" | "failed" | "cancelled";
|
|
21
|
-
type AgentStopReason = "schema_satisfied" | "budget_reached" | "error" | "cancelled";
|
|
21
|
+
type AgentStopReason = "schema_satisfied" | "budget_reached" | "stopped" | "error" | "cancelled";
|
|
22
22
|
type AgentConfidence = "low" | "medium" | "high";
|
|
23
23
|
type AgentEffort = "minimal" | "low" | "medium" | "high" | "xhigh" | "auto" | "max";
|
|
24
24
|
/** Per-run spend ceiling for the metered `auto` and `max` efforts. */
|
|
@@ -709,6 +709,11 @@ declare class AgentBetaRunsClient extends AgentRunsClient {
|
|
|
709
709
|
listAll(options?: WithBetaOptions<ListAgentRunsParams>): AsyncGenerator<AgentRun>;
|
|
710
710
|
getAll(options?: WithBetaOptions<ListAgentRunsParams>): Promise<AgentRun[]>;
|
|
711
711
|
cancel(runId: string, options?: AgentBetaOptions): Promise<AgentRun>;
|
|
712
|
+
/**
|
|
713
|
+
* Stop a running Agent run, completing it early with the results
|
|
714
|
+
* gathered so far. Only supported for `max` effort runs.
|
|
715
|
+
*/
|
|
716
|
+
stop(runId: string, options?: AgentBetaOptions): Promise<AgentRun>;
|
|
712
717
|
delete(runId: string, options?: AgentBetaOptions): Promise<DeletedAgentRun>;
|
|
713
718
|
pollUntilFinished(runId: string, options?: WithBetaOptions<AgentWaitOptions>): Promise<AgentTerminalRun>;
|
|
714
719
|
createAndWait<T>(params: WithBetaOptions<Omit<AgentCreateOptions<T>, "stream">>, options?: AgentWaitOptions): Promise<AgentCompletedRunTyped<T>>;
|
|
@@ -3950,6 +3955,220 @@ declare class WebsetsClient extends WebsetsBaseClient {
|
|
|
3950
3955
|
} | number): Promise<Webset>;
|
|
3951
3956
|
}
|
|
3952
3957
|
|
|
3958
|
+
type ToolJsonSchema = {
|
|
3959
|
+
type: "object";
|
|
3960
|
+
properties?: Record<string, unknown>;
|
|
3961
|
+
required?: string[];
|
|
3962
|
+
additionalProperties?: boolean;
|
|
3963
|
+
[key: string]: unknown;
|
|
3964
|
+
};
|
|
3965
|
+
type ToolDefinition = {
|
|
3966
|
+
name: string;
|
|
3967
|
+
description: string;
|
|
3968
|
+
parameters?: ToolJsonSchema;
|
|
3969
|
+
input_schema?: ToolJsonSchema;
|
|
3970
|
+
strict?: boolean;
|
|
3971
|
+
};
|
|
3972
|
+
type ExaToolSpec<Args = unknown, Result = unknown> = {
|
|
3973
|
+
name: string;
|
|
3974
|
+
description: string;
|
|
3975
|
+
inputSchema: z.ZodType<Args>;
|
|
3976
|
+
jsonSchema: ToolJsonSchema;
|
|
3977
|
+
execute(args: Args): Promise<Result>;
|
|
3978
|
+
format(result: Result): string;
|
|
3979
|
+
definition: ToolDefinition;
|
|
3980
|
+
run(args: unknown): Promise<string>;
|
|
3981
|
+
};
|
|
3982
|
+
type WebSearchToolConfig = RegularSearchOptions & {
|
|
3983
|
+
/**
|
|
3984
|
+
* Tool name shown to the model. Defaults to `"web_search"`. Set a custom
|
|
3985
|
+
* name to avoid collisions, e.g. with Anthropic's built-in `web_search`
|
|
3986
|
+
* server tool, or to register multiple differently-configured search tools.
|
|
3987
|
+
*/
|
|
3988
|
+
name?: string;
|
|
3989
|
+
/** Tool description shown to the model. */
|
|
3990
|
+
description?: string;
|
|
3991
|
+
};
|
|
3992
|
+
type GetContentsToolConfig = ContentsOptions & {
|
|
3993
|
+
/**
|
|
3994
|
+
* Tool name shown to the model. Defaults to `"get_contents"`. Set a custom
|
|
3995
|
+
* name to avoid collisions, or to register multiple differently-configured
|
|
3996
|
+
* contents tools.
|
|
3997
|
+
*/
|
|
3998
|
+
name?: string;
|
|
3999
|
+
/** Tool description shown to the model. */
|
|
4000
|
+
description?: string;
|
|
4001
|
+
};
|
|
4002
|
+
type ToolNamespace = {
|
|
4003
|
+
webSearch(config?: WebSearchToolConfig): WebSearchTool;
|
|
4004
|
+
getContents(config?: GetContentsToolConfig): GetContentsTool;
|
|
4005
|
+
};
|
|
4006
|
+
type SearchArgs = {
|
|
4007
|
+
query: string;
|
|
4008
|
+
};
|
|
4009
|
+
type GetContentsArgs = {
|
|
4010
|
+
urls: string[];
|
|
4011
|
+
};
|
|
4012
|
+
type WebSearchTool = ExaToolSpec<SearchArgs, SearchResponse<ContentsOptions>>;
|
|
4013
|
+
type GetContentsTool = ExaToolSpec<GetContentsArgs, SearchResponse<ContentsOptions>>;
|
|
4014
|
+
declare const DEFAULT_WEB_SEARCH_TOOL_DESCRIPTION = "Search the web for up-to-date, relevant information. Describe the ideal page rather than listing keywords.";
|
|
4015
|
+
declare const DEFAULT_GET_CONTENTS_TOOL_DESCRIPTION = "Read the full contents of web pages you already have URLs for, such as pages returned by a search or mentioned by the user.";
|
|
4016
|
+
/** Create a `web_search` tool. Defaults to `type: "auto"` and highlights. */
|
|
4017
|
+
declare function createWebSearchTool(exa: Exa, registry: ToolRegistry, config?: WebSearchToolConfig): WebSearchTool;
|
|
4018
|
+
/**
|
|
4019
|
+
* Create a `get_contents` tool that reads pages the model already has URLs for.
|
|
4020
|
+
* Inherits `exa.getContents` defaults, which return page text when no content
|
|
4021
|
+
* option is configured.
|
|
4022
|
+
*/
|
|
4023
|
+
declare function createGetContentsTool(exa: Exa, registry: ToolRegistry, config?: GetContentsToolConfig): GetContentsTool;
|
|
4024
|
+
declare class ToolRegistry {
|
|
4025
|
+
private readonly registry;
|
|
4026
|
+
register(tool: ExaToolSpec): void;
|
|
4027
|
+
resolve(tools?: readonly ExaToolSpec[]): Map<string, ExaToolSpec>;
|
|
4028
|
+
}
|
|
4029
|
+
|
|
4030
|
+
type AnthropicMessage = {
|
|
4031
|
+
content?: readonly unknown[] | null;
|
|
4032
|
+
};
|
|
4033
|
+
type AnthropicToolResult = {
|
|
4034
|
+
type: "tool_result";
|
|
4035
|
+
tool_use_id: string;
|
|
4036
|
+
content: string;
|
|
4037
|
+
};
|
|
4038
|
+
type AnthropicRunnable = ExaToolSpec & {
|
|
4039
|
+
type: "custom";
|
|
4040
|
+
name: string;
|
|
4041
|
+
description: string;
|
|
4042
|
+
input_schema: ExaToolSpec["jsonSchema"];
|
|
4043
|
+
parse: (input: unknown) => unknown;
|
|
4044
|
+
run: (args: unknown) => Promise<string>;
|
|
4045
|
+
definition: ToolDefinition & {
|
|
4046
|
+
input_schema: ExaToolSpec["jsonSchema"];
|
|
4047
|
+
};
|
|
4048
|
+
};
|
|
4049
|
+
declare class AnthropicTools {
|
|
4050
|
+
private readonly exa;
|
|
4051
|
+
private readonly registry;
|
|
4052
|
+
constructor(exa: Exa, registry: ToolRegistry);
|
|
4053
|
+
/** Anthropic `web_search` tool. Defaults to `auto` + highlights. */
|
|
4054
|
+
webSearch(config?: WebSearchToolConfig): AnthropicRunnable;
|
|
4055
|
+
/** Anthropic `get_contents` tool for reading pages by URL. */
|
|
4056
|
+
getContents(config?: GetContentsToolConfig): AnthropicRunnable;
|
|
4057
|
+
/**
|
|
4058
|
+
* Run the `tool_use` blocks in an assistant message and return the matching
|
|
4059
|
+
* `tool_result` blocks. Every `tool_use` block is answered so the follow-up
|
|
4060
|
+
* request never omits a required result: a block whose name doesn't match a
|
|
4061
|
+
* known tool gets an `Error: unknown tool "<name>"` result. When handling
|
|
4062
|
+
* some tools yourself, replace those error results with your own before
|
|
4063
|
+
* sending the next request.
|
|
4064
|
+
*/
|
|
4065
|
+
handleToolUse(message: AnthropicMessage, options?: {
|
|
4066
|
+
tools?: readonly ExaToolSpec[];
|
|
4067
|
+
}): Promise<AnthropicToolResult[]>;
|
|
4068
|
+
}
|
|
4069
|
+
|
|
4070
|
+
type OpenAIAssistantMessage = {
|
|
4071
|
+
tool_calls?: readonly unknown[] | null;
|
|
4072
|
+
};
|
|
4073
|
+
type OpenAIToolMessage = {
|
|
4074
|
+
role: "tool";
|
|
4075
|
+
tool_call_id: string;
|
|
4076
|
+
content: string;
|
|
4077
|
+
};
|
|
4078
|
+
type ResponsesOutput = {
|
|
4079
|
+
output?: readonly unknown[];
|
|
4080
|
+
};
|
|
4081
|
+
type ResponsesFunctionCallOutput = {
|
|
4082
|
+
type: "function_call_output";
|
|
4083
|
+
call_id: string;
|
|
4084
|
+
output: string;
|
|
4085
|
+
};
|
|
4086
|
+
type OpenAIChatDefinition = {
|
|
4087
|
+
type: "function";
|
|
4088
|
+
function: {
|
|
4089
|
+
name: string;
|
|
4090
|
+
description: string;
|
|
4091
|
+
parameters: any;
|
|
4092
|
+
};
|
|
4093
|
+
};
|
|
4094
|
+
type OpenAIRunnable = ExaToolSpec & {
|
|
4095
|
+
type: "function";
|
|
4096
|
+
function: {
|
|
4097
|
+
name: string;
|
|
4098
|
+
description: string;
|
|
4099
|
+
parameters: any;
|
|
4100
|
+
parse: (input: string) => any;
|
|
4101
|
+
function: (args: any, runner?: unknown) => Promise<string>;
|
|
4102
|
+
};
|
|
4103
|
+
definition: OpenAIChatDefinition;
|
|
4104
|
+
};
|
|
4105
|
+
type OpenAIResponsesRunnable = ExaToolSpec & {
|
|
4106
|
+
type: "function";
|
|
4107
|
+
name: string;
|
|
4108
|
+
description: string;
|
|
4109
|
+
parameters: any;
|
|
4110
|
+
strict: false;
|
|
4111
|
+
definition: ToolDefinition & {
|
|
4112
|
+
type: "function";
|
|
4113
|
+
parameters: ToolJsonSchema;
|
|
4114
|
+
strict: false;
|
|
4115
|
+
};
|
|
4116
|
+
};
|
|
4117
|
+
declare class OpenAIResponsesTools {
|
|
4118
|
+
private readonly exa;
|
|
4119
|
+
private readonly registry;
|
|
4120
|
+
private readonly handleResponses;
|
|
4121
|
+
constructor(exa: Exa, registry: ToolRegistry, handleResponses: (responseOrOutputItems: ResponsesOutput | readonly unknown[], options?: {
|
|
4122
|
+
tools?: readonly ExaToolSpec[];
|
|
4123
|
+
}) => Promise<ResponsesFunctionCallOutput[]>);
|
|
4124
|
+
/** Responses API `web_search` tool. Defaults to `auto` + highlights. */
|
|
4125
|
+
webSearch(config?: WebSearchToolConfig): OpenAIResponsesRunnable;
|
|
4126
|
+
/** Responses API `get_contents` tool for reading pages by URL. */
|
|
4127
|
+
getContents(config?: GetContentsToolConfig): OpenAIResponsesRunnable;
|
|
4128
|
+
/**
|
|
4129
|
+
* Run the function calls in a Responses API response (or output item array)
|
|
4130
|
+
* and return `function_call_output` items. Every function call is answered
|
|
4131
|
+
* so the follow-up request never omits a required output: a call whose name
|
|
4132
|
+
* doesn't match a known tool gets an `Error: unknown tool "<name>"` output.
|
|
4133
|
+
* When handling some tools yourself, replace those error outputs with your
|
|
4134
|
+
* own results before sending the next request.
|
|
4135
|
+
*/
|
|
4136
|
+
handleToolCalls(responseOrOutputItems: ResponsesOutput | readonly unknown[], options?: {
|
|
4137
|
+
tools?: readonly ExaToolSpec[];
|
|
4138
|
+
}): Promise<ResponsesFunctionCallOutput[]>;
|
|
4139
|
+
}
|
|
4140
|
+
declare class OpenAITools {
|
|
4141
|
+
private readonly exa;
|
|
4142
|
+
private readonly registry;
|
|
4143
|
+
readonly responses: OpenAIResponsesTools;
|
|
4144
|
+
constructor(exa: Exa, registry: ToolRegistry);
|
|
4145
|
+
/** Chat Completions `web_search` tool. Defaults to `auto` + highlights. */
|
|
4146
|
+
webSearch(config?: WebSearchToolConfig): OpenAIRunnable;
|
|
4147
|
+
/** Chat Completions `get_contents` tool for reading pages by URL. */
|
|
4148
|
+
getContents(config?: GetContentsToolConfig): OpenAIRunnable;
|
|
4149
|
+
/**
|
|
4150
|
+
* Run the tool calls in a Chat Completions assistant message and return the
|
|
4151
|
+
* matching `role: "tool"` messages. Every tool call is answered so the
|
|
4152
|
+
* follow-up request never omits a required tool response: a call whose name
|
|
4153
|
+
* doesn't match a known tool gets an `Error: unknown tool "<name>"` output.
|
|
4154
|
+
* When handling some tools yourself, replace those error outputs with your
|
|
4155
|
+
* own results before sending the next request.
|
|
4156
|
+
*/
|
|
4157
|
+
handleToolCalls(assistantMessage: OpenAIAssistantMessage, options?: {
|
|
4158
|
+
tools?: readonly ExaToolSpec[];
|
|
4159
|
+
}): Promise<OpenAIToolMessage[]>;
|
|
4160
|
+
/**
|
|
4161
|
+
* Run the function calls in a Responses API response (or output item array)
|
|
4162
|
+
* and return `function_call_output` items, answering calls whose name
|
|
4163
|
+
* doesn't match a known tool with `Error: unknown tool "<name>"` outputs.
|
|
4164
|
+
*/
|
|
4165
|
+
handleToolCalls(responseOrOutputItems: ResponsesOutput | readonly unknown[], options?: {
|
|
4166
|
+
tools?: readonly ExaToolSpec[];
|
|
4167
|
+
}): Promise<ResponsesFunctionCallOutput[]>;
|
|
4168
|
+
private handleChatToolCalls;
|
|
4169
|
+
private handleResponsesToolCalls;
|
|
4170
|
+
}
|
|
4171
|
+
|
|
3953
4172
|
/**
|
|
3954
4173
|
* HTTP status codes
|
|
3955
4174
|
*/
|
|
@@ -4028,6 +4247,8 @@ declare class ExaError extends Error {
|
|
|
4028
4247
|
constructor(message: string, statusCode: number, timestamp?: string, path?: string, envelope?: ExaErrorEnvelope);
|
|
4029
4248
|
}
|
|
4030
4249
|
|
|
4250
|
+
/** Exa-Beta token required for Dynamic Highlights (research preview). */
|
|
4251
|
+
declare const DYNAMIC_HIGHLIGHTS_BETA = "dynamic-highlights-2026-08-28";
|
|
4031
4252
|
/**
|
|
4032
4253
|
* Options for retrieving page contents
|
|
4033
4254
|
* @typedef {Object} ContentsOptions
|
|
@@ -4187,6 +4408,14 @@ type NonDeepSearchOptions = BaseRegularSearchOptions & {
|
|
|
4187
4408
|
* Uses a discriminated union to ensure additionalQueries is only allowed when type is a deep search variant.
|
|
4188
4409
|
*/
|
|
4189
4410
|
type RegularSearchOptions = DeepSearchOptions | NonDeepSearchOptions;
|
|
4411
|
+
/**
|
|
4412
|
+
* Options for opting into Exa-Beta features.
|
|
4413
|
+
* @typedef {Object} BetaOptions
|
|
4414
|
+
* @property {string[]} [betas] - Exa-Beta tokens to send with the request (e.g. `[DYNAMIC_HIGHLIGHTS_BETA]` for Dynamic Highlights).
|
|
4415
|
+
*/
|
|
4416
|
+
type BetaOptions = {
|
|
4417
|
+
betas?: string[];
|
|
4418
|
+
};
|
|
4190
4419
|
/**
|
|
4191
4420
|
* DEPRECATED: Used only by deprecated `findSimilar()` APIs. Use `search()` and `RegularSearchOptions` for new search flows. Will be removed in a future version.
|
|
4192
4421
|
* @deprecated Use `search()` and `RegularSearchOptions` for new search flows. There is no direct replacement for URL-based similarity.
|
|
@@ -4239,13 +4468,15 @@ type TextContentsOptions = {
|
|
|
4239
4468
|
* Deep search variants also support these options for returned highlights.
|
|
4240
4469
|
* @typedef {Object} HighlightsContentsOptions
|
|
4241
4470
|
* @property {string} [query] - The query string to use for highlights search.
|
|
4242
|
-
* @property {number} [maxCharacters] - The maximum number of characters to return for highlights.
|
|
4471
|
+
* @property {number} [maxCharacters] - The maximum number of characters to return for highlights. Not compatible with `dynamic`.
|
|
4472
|
+
* @property {boolean} [dynamic] - Enable Dynamic Highlights (research preview): allocates one shared context budget across all results instead of a per-document budget; the model sizes the output itself. Not compatible with `maxCharacters`. Beta: requires passing `betas: [DYNAMIC_HIGHLIGHTS_BETA]` to the request.
|
|
4243
4473
|
* @property {number} [numSentences] - DEPRECATED: Use maxCharacters instead.
|
|
4244
4474
|
* @property {number} [highlightsPerUrl] - DEPRECATED: Use maxCharacters instead.
|
|
4245
4475
|
*/
|
|
4246
4476
|
type HighlightsContentsOptions = {
|
|
4247
4477
|
query?: string;
|
|
4248
4478
|
maxCharacters?: number;
|
|
4479
|
+
dynamic?: boolean;
|
|
4249
4480
|
/**
|
|
4250
4481
|
* DEPRECATED: Use `maxCharacters` instead. Will be removed in a future version.
|
|
4251
4482
|
* @deprecated Use `maxCharacters` instead. This legacy sizing field will be removed in a future version.
|
|
@@ -4622,6 +4853,13 @@ declare class Exa {
|
|
|
4622
4853
|
* Beta API clients
|
|
4623
4854
|
*/
|
|
4624
4855
|
beta: BetaClient;
|
|
4856
|
+
/** Provider-neutral Exa tools. */
|
|
4857
|
+
tools: ToolNamespace;
|
|
4858
|
+
/** OpenAI Chat Completions and Responses API tools. */
|
|
4859
|
+
openai: OpenAITools;
|
|
4860
|
+
/** Anthropic Messages API tools. */
|
|
4861
|
+
anthropic: AnthropicTools;
|
|
4862
|
+
private readonly toolRegistry;
|
|
4625
4863
|
/**
|
|
4626
4864
|
* Helper method to separate out the contents-specific options from the rest.
|
|
4627
4865
|
*/
|
|
@@ -4663,7 +4901,7 @@ declare class Exa {
|
|
|
4663
4901
|
* @param {RegularSearchOptions & { contents: false }} options - Search options with contents explicitly disabled
|
|
4664
4902
|
* @returns {Promise<SearchResponse<{}>>} A list of relevant search results without contents.
|
|
4665
4903
|
*/
|
|
4666
|
-
search(query: string, options: RegularSearchOptions & {
|
|
4904
|
+
search(query: string, options: RegularSearchOptions & BetaOptions & {
|
|
4667
4905
|
contents: false | null | undefined;
|
|
4668
4906
|
}): Promise<SearchResponse<{}>>;
|
|
4669
4907
|
/**
|
|
@@ -4673,7 +4911,7 @@ declare class Exa {
|
|
|
4673
4911
|
* @param {RegularSearchOptions & { contents: T }} options - Search options with specific contents
|
|
4674
4912
|
* @returns {Promise<SearchResponse<T>>} A list of relevant search results with requested contents.
|
|
4675
4913
|
*/
|
|
4676
|
-
search<T extends ContentsOptions>(query: string, options: RegularSearchOptions & {
|
|
4914
|
+
search<T extends ContentsOptions>(query: string, options: RegularSearchOptions & BetaOptions & {
|
|
4677
4915
|
contents: T;
|
|
4678
4916
|
}): Promise<SearchResponse<T>>;
|
|
4679
4917
|
/**
|
|
@@ -4684,7 +4922,7 @@ declare class Exa {
|
|
|
4684
4922
|
* @param {Omit<DeepSearchOptions, 'contents'> | Omit<NonDeepSearchOptions, 'contents'>} options - Search options without contents
|
|
4685
4923
|
* @returns {Promise<SearchResponse<{ text: true }>>} A list of relevant search results with text contents.
|
|
4686
4924
|
*/
|
|
4687
|
-
search(query: string, options: Omit<DeepSearchOptions, "contents"> | Omit<NonDeepSearchOptions, "contents">): Promise<SearchResponse<{
|
|
4925
|
+
search(query: string, options: (Omit<DeepSearchOptions, "contents"> | Omit<NonDeepSearchOptions, "contents">) & BetaOptions): Promise<SearchResponse<{
|
|
4688
4926
|
text: true;
|
|
4689
4927
|
}>>;
|
|
4690
4928
|
/**
|
|
@@ -4788,7 +5026,7 @@ declare class Exa {
|
|
|
4788
5026
|
* @param {ContentsOptions} [options] - Additional options for retrieving document contents.
|
|
4789
5027
|
* @returns {Promise<SearchResponse<T>>} A list of document contents for the requested URLs.
|
|
4790
5028
|
*/
|
|
4791
|
-
getContents<T extends ContentsOptions>(urls: string | string[] | SearchResult<T>[], options?: T): Promise<SearchResponse<T>>;
|
|
5029
|
+
getContents<T extends ContentsOptions>(urls: string | string[] | SearchResult<T>[], options?: T & BetaOptions): Promise<SearchResponse<T>>;
|
|
4792
5030
|
/**
|
|
4793
5031
|
* Generate an answer with Zod schema for strongly typed output
|
|
4794
5032
|
*/
|
|
@@ -4858,4 +5096,4 @@ declare class Exa {
|
|
|
4858
5096
|
private parseSSEStream;
|
|
4859
5097
|
}
|
|
4860
5098
|
|
|
4861
|
-
export { AGENT_BETA_HEADER, AGENT_MAX_EFFORT_BETA, AGENT_MONITORS_BETA_HEADER, type AddAgentMonitorEntitiesParams, AgentBetaClient, type AgentBetaOptions, type AgentBudget, AgentClient, type AgentConfidence, type AgentCostDollars, type AgentCreateOptions, type AgentDataSource, type AgentDataSourceProvider, type AgentEffort, type AgentError, type AgentEvent, type AgentGroundingCitation, type AgentGroundingEntry, type AgentInput, type AgentMonitor, type AgentMonitorChange, type AgentMonitorChangeEntity, type AgentMonitorChangeField, AgentMonitorChangesClient, type AgentMonitorCitation, type AgentMonitorContent, type AgentMonitorCreation, AgentMonitorEntitiesClient, type AgentMonitorEntity, type AgentMonitorEntityView, type AgentMonitorField, type AgentMonitorFieldMode, type AgentMonitorFieldValueType, type AgentMonitorRefresh, type AgentMonitorSnapshot, type AgentMonitorSnapshotEntity, AgentMonitorSnapshotFailedError, type AgentMonitorSnapshotResult, type AgentMonitorSnapshotStatus, type AgentMonitorSnapshotWaitOptions, AgentMonitorSnapshotsClient, type AgentMonitorStatus, type AgentMonitorUsage, type AgentMonitorsBetaOptions, AgentMonitorsClient, type AgentOutput, type AgentRun, AgentRunCancelledError, AgentRunEventsClient, AgentRunFailedError, type AgentRunStatus, type AgentRunTyped, AgentRunsClient, type AgentStopReason, type AgentUsage, type AgentWaitOptions, type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type ArticleEntity, type BaseSearchOptions, BetaClient, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateAgentMonitorEntityParams, type CreateAgentMonitorFieldParams, type CreateAgentMonitorOptions, type CreateAgentMonitorParams, type CreateAgentMonitorSnapshotParams, type CreateAgentRunParams, type CreateAgentRunParamsTyped, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateSearchMonitorParams, type CreateSearchMonitorResponse, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type CsvDataInput, type CustomEntity, type DeepObjectOutputSchema, type DeepOutputSchema, type DeepSearchOutput, type DeepSearchOutputGrounding, type DeepSearchOutputGroundingCitation, type DeepSearchOutputGroundingConfidence, type DeepSearchType, type DeepTextOutputSchema, type Default, type DeletedAgentMonitor, type DeletedAgentRun, type EnrichmentResult, type Entity, type EntityCompanyProperties, type EntityCompanyPropertiesFinancials, type EntityCompanyPropertiesFundingRound, type EntityCompanyPropertiesHeadquarters, type EntityCompanyPropertiesWebTraffic, type EntityCompanyPropertiesWorkforce, type EntityDateRange, type EntityPersonProperties, type EntityPersonPropertiesCompanyRef, type EntityPersonPropertiesWorkHistoryEntry, type Event, EventType, EventsClient, Exa, ExaError, type ExaErrorEnvelope, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetWebsetResponse, type GroundingCitation, type GroundingEntry, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListAgentMonitorChangesParams, type ListAgentMonitorChangesResponse, type ListAgentMonitorEntitiesParams, type ListAgentMonitorEntitiesResponse, type ListAgentMonitorsParams, type ListAgentMonitorsResponse, type ListAgentRunEventsParams, type ListAgentRunEventsResponse, type ListAgentRunsParams, type ListAgentRunsResponse, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type ListResearchRequest, type ListResearchResponse, type ListSearchMonitorRunsParams, type ListSearchMonitorRunsResponse, type ListSearchMonitorsParams, type ListSearchMonitorsResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, type RegularSearchOptions, type Research, type ResearchCreateParamsTyped, type ResearchCreateRequest, type ResearchCreateResponse, type ResearchDefinitionEvent, type ResearchEvent, type ResearchOperation, type ResearchOutputEvent, type ResearchPaperEntity, type ResearchPlanDefinitionEvent, type ResearchPlanOperationEvent, type ResearchPlanOutputEvent, type ResearchStatus, type ResearchStreamEvent, type ResearchStreamEventTyped, type ResearchTaskDefinitionEvent, type ResearchTaskOperationEvent, type ResearchTaskOutputEvent, type ResearchTyped, type SearchMonitor, type SearchMonitorRun, type SearchMonitorRunFailReason, type SearchMonitorRunOutput, type SearchMonitorRunStatus, SearchMonitorRunsClient, type SearchMonitorSearch, type SearchMonitorStatus, type SearchMonitorTrigger, type SearchMonitorWebhook, type SearchMonitorWebhookEvent, SearchMonitorsClient, type SearchResponse, type SearchResult, type SearchStreamChunk, type SectionTag, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type TriggerSearchMonitorResponse, type UpdateEnrichmentParameters, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateSearchMonitorParams, type UpdateWebhookParameters, type UpdateWebsetRequest, type VerbosityOptions, type WaitUntilCompletedOptions, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, WebsetExcludeSource, type WebsetHeadersLike, WebsetImportSource, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchScopeSource, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, Exa as default };
|
|
5099
|
+
export { AGENT_BETA_HEADER, AGENT_MAX_EFFORT_BETA, AGENT_MONITORS_BETA_HEADER, type AddAgentMonitorEntitiesParams, AgentBetaClient, type AgentBetaOptions, type AgentBudget, AgentClient, type AgentConfidence, type AgentCostDollars, type AgentCreateOptions, type AgentDataSource, type AgentDataSourceProvider, type AgentEffort, type AgentError, type AgentEvent, type AgentGroundingCitation, type AgentGroundingEntry, type AgentInput, type AgentMonitor, type AgentMonitorChange, type AgentMonitorChangeEntity, type AgentMonitorChangeField, AgentMonitorChangesClient, type AgentMonitorCitation, type AgentMonitorContent, type AgentMonitorCreation, AgentMonitorEntitiesClient, type AgentMonitorEntity, type AgentMonitorEntityView, type AgentMonitorField, type AgentMonitorFieldMode, type AgentMonitorFieldValueType, type AgentMonitorRefresh, type AgentMonitorSnapshot, type AgentMonitorSnapshotEntity, AgentMonitorSnapshotFailedError, type AgentMonitorSnapshotResult, type AgentMonitorSnapshotStatus, type AgentMonitorSnapshotWaitOptions, AgentMonitorSnapshotsClient, type AgentMonitorStatus, type AgentMonitorUsage, type AgentMonitorsBetaOptions, AgentMonitorsClient, type AgentOutput, type AgentRun, AgentRunCancelledError, AgentRunEventsClient, AgentRunFailedError, type AgentRunStatus, type AgentRunTyped, AgentRunsClient, type AgentStopReason, type AgentUsage, type AgentWaitOptions, type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type AnthropicToolResult, AnthropicTools, type ArticleEntity, type BaseSearchOptions, BetaClient, type BetaOptions, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateAgentMonitorEntityParams, type CreateAgentMonitorFieldParams, type CreateAgentMonitorOptions, type CreateAgentMonitorParams, type CreateAgentMonitorSnapshotParams, type CreateAgentRunParams, type CreateAgentRunParamsTyped, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateSearchMonitorParams, type CreateSearchMonitorResponse, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type CsvDataInput, type CustomEntity, DEFAULT_GET_CONTENTS_TOOL_DESCRIPTION, DEFAULT_WEB_SEARCH_TOOL_DESCRIPTION, DYNAMIC_HIGHLIGHTS_BETA, type DeepObjectOutputSchema, type DeepOutputSchema, type DeepSearchOutput, type DeepSearchOutputGrounding, type DeepSearchOutputGroundingCitation, type DeepSearchOutputGroundingConfidence, type DeepSearchType, type DeepTextOutputSchema, type Default, type DeletedAgentMonitor, type DeletedAgentRun, type EnrichmentResult, type Entity, type EntityCompanyProperties, type EntityCompanyPropertiesFinancials, type EntityCompanyPropertiesFundingRound, type EntityCompanyPropertiesHeadquarters, type EntityCompanyPropertiesWebTraffic, type EntityCompanyPropertiesWorkforce, type EntityDateRange, type EntityPersonProperties, type EntityPersonPropertiesCompanyRef, type EntityPersonPropertiesWorkHistoryEntry, type Event, EventType, EventsClient, Exa, ExaError, type ExaErrorEnvelope, type ExaToolSpec, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetContentsTool, type GetContentsToolConfig, type GetWebsetResponse, type GroundingCitation, type GroundingEntry, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListAgentMonitorChangesParams, type ListAgentMonitorChangesResponse, type ListAgentMonitorEntitiesParams, type ListAgentMonitorEntitiesResponse, type ListAgentMonitorsParams, type ListAgentMonitorsResponse, type ListAgentRunEventsParams, type ListAgentRunEventsResponse, type ListAgentRunsParams, type ListAgentRunsResponse, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type ListResearchRequest, type ListResearchResponse, type ListSearchMonitorRunsParams, type ListSearchMonitorRunsResponse, type ListSearchMonitorsParams, type ListSearchMonitorsResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, OpenAIResponsesTools, type OpenAIToolMessage, OpenAITools, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, type RegularSearchOptions, type Research, type ResearchCreateParamsTyped, type ResearchCreateRequest, type ResearchCreateResponse, type ResearchDefinitionEvent, type ResearchEvent, type ResearchOperation, type ResearchOutputEvent, type ResearchPaperEntity, type ResearchPlanDefinitionEvent, type ResearchPlanOperationEvent, type ResearchPlanOutputEvent, type ResearchStatus, type ResearchStreamEvent, type ResearchStreamEventTyped, type ResearchTaskDefinitionEvent, type ResearchTaskOperationEvent, type ResearchTaskOutputEvent, type ResearchTyped, type ResponsesFunctionCallOutput, type SearchMonitor, type SearchMonitorRun, type SearchMonitorRunFailReason, type SearchMonitorRunOutput, type SearchMonitorRunStatus, SearchMonitorRunsClient, type SearchMonitorSearch, type SearchMonitorStatus, type SearchMonitorTrigger, type SearchMonitorWebhook, type SearchMonitorWebhookEvent, SearchMonitorsClient, type SearchResponse, type SearchResult, type SearchStreamChunk, type SectionTag, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type ToolDefinition, type ToolJsonSchema, type ToolNamespace, ToolRegistry, type TriggerSearchMonitorResponse, type UpdateEnrichmentParameters, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateSearchMonitorParams, type UpdateWebhookParameters, type UpdateWebsetRequest, type VerbosityOptions, type WaitUntilCompletedOptions, type WebSearchTool, type WebSearchToolConfig, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, WebsetExcludeSource, type WebsetHeadersLike, WebsetImportSource, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchScopeSource, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, createGetContentsTool, createWebSearchTool, Exa as default };
|