parallel-web 0.3.2 → 0.4.1
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/CHANGELOG.md +54 -0
- package/client.d.mts +44 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +44 -2
- package/client.d.ts.map +1 -1
- package/client.js +43 -0
- package/client.js.map +1 -1
- package/client.mjs +43 -0
- package/client.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/package.json +12 -1
- package/resources/beta/beta.d.mts +42 -61
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +42 -61
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +3 -2
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +3 -2
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/findall.d.mts +167 -8
- package/resources/beta/findall.d.mts.map +1 -1
- package/resources/beta/findall.d.ts +167 -8
- package/resources/beta/findall.d.ts.map +1 -1
- package/resources/beta/findall.js +108 -0
- package/resources/beta/findall.js.map +1 -1
- package/resources/beta/findall.mjs +108 -0
- package/resources/beta/findall.mjs.map +1 -1
- package/resources/beta/index.d.mts +2 -2
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +2 -2
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/task-group.d.mts +50 -5
- package/resources/beta/task-group.d.mts.map +1 -1
- package/resources/beta/task-group.d.ts +50 -5
- package/resources/beta/task-group.d.ts.map +1 -1
- package/resources/beta/task-group.js +45 -3
- package/resources/beta/task-group.js.map +1 -1
- package/resources/beta/task-group.mjs +45 -3
- package/resources/beta/task-group.mjs.map +1 -1
- package/resources/beta/task-run.d.mts +77 -270
- package/resources/beta/task-run.d.mts.map +1 -1
- package/resources/beta/task-run.d.ts +77 -270
- package/resources/beta/task-run.d.ts.map +1 -1
- package/resources/beta/task-run.js +17 -2
- package/resources/beta/task-run.js.map +1 -1
- package/resources/beta/task-run.mjs +17 -2
- package/resources/beta/task-run.mjs.map +1 -1
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/shared.d.mts +4 -2
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +4 -2
- package/resources/shared.d.ts.map +1 -1
- package/resources/task-run.d.mts +308 -30
- package/resources/task-run.d.mts.map +1 -1
- package/resources/task-run.d.ts +308 -30
- package/resources/task-run.d.ts.map +1 -1
- package/resources/task-run.js +67 -4
- package/resources/task-run.js.map +1 -1
- package/resources/task-run.mjs +67 -4
- package/resources/task-run.mjs.map +1 -1
- package/resources/top-level.d.mts +317 -0
- package/resources/top-level.d.mts.map +1 -0
- package/resources/top-level.d.ts +317 -0
- package/resources/top-level.d.ts.map +1 -0
- package/resources/top-level.js +4 -0
- package/resources/top-level.js.map +1 -0
- package/resources/top-level.mjs +3 -0
- package/resources/top-level.mjs.map +1 -0
- package/src/client.ts +90 -0
- package/src/internal/utils/env.ts +2 -2
- package/src/resources/beta/api.md +12 -9
- package/src/resources/beta/beta.ts +59 -73
- package/src/resources/beta/findall.ts +187 -7
- package/src/resources/beta/index.ts +7 -4
- package/src/resources/beta/task-group.ts +54 -7
- package/src/resources/beta/task-run.ts +94 -305
- package/src/resources/index.ts +20 -0
- package/src/resources/shared.ts +4 -2
- package/src/resources/task-run.ts +391 -32
- package/src/resources/top-level.ts +385 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as Shared from '../shared';
|
|
5
|
+
import * as TopLevelAPI from '../top-level';
|
|
5
6
|
import * as FindAllAPI from './findall';
|
|
6
7
|
import {
|
|
7
8
|
FindAll,
|
|
8
9
|
FindAllCancelParams,
|
|
9
10
|
FindAllCancelResponse,
|
|
10
11
|
FindAllCandidateMatchStatusEvent,
|
|
12
|
+
FindAllCandidatesParams,
|
|
13
|
+
FindAllCandidatesRequest,
|
|
14
|
+
FindAllCandidatesResponse,
|
|
11
15
|
FindAllCreateParams,
|
|
12
16
|
FindAllEnrichInput,
|
|
13
17
|
FindAllEnrichParams,
|
|
@@ -66,8 +70,7 @@ export class Beta extends APIResource {
|
|
|
66
70
|
/**
|
|
67
71
|
* Extracts relevant content from specific web URLs.
|
|
68
72
|
*
|
|
69
|
-
*
|
|
70
|
-
* `search-extract-2025-10-10`.
|
|
73
|
+
* @deprecated Use client.extract instead. For more info, see https://docs.parallel.ai/extract/extract-migration-guide
|
|
71
74
|
*/
|
|
72
75
|
extract(params: BetaExtractParams, options?: RequestOptions): APIPromise<ExtractResponse> {
|
|
73
76
|
const { betas, ...body } = params;
|
|
@@ -83,6 +86,8 @@ export class Beta extends APIResource {
|
|
|
83
86
|
|
|
84
87
|
/**
|
|
85
88
|
* Searches the web.
|
|
89
|
+
*
|
|
90
|
+
* @deprecated Use client.search instead. For more info, see https://docs.parallel.ai/search/search-migration-guide
|
|
86
91
|
*/
|
|
87
92
|
search(params: BetaSearchParams, options?: RequestOptions): APIPromise<SearchResult> {
|
|
88
93
|
const { betas, ...body } = params;
|
|
@@ -117,28 +122,6 @@ export interface ExcerptSettings {
|
|
|
117
122
|
max_chars_total?: number | null;
|
|
118
123
|
}
|
|
119
124
|
|
|
120
|
-
/**
|
|
121
|
-
* Extract error details.
|
|
122
|
-
*/
|
|
123
|
-
export interface ExtractError {
|
|
124
|
-
/**
|
|
125
|
-
* Content returned for http client or server errors, if any.
|
|
126
|
-
*/
|
|
127
|
-
content: string | null;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Error type.
|
|
131
|
-
*/
|
|
132
|
-
error_type: string;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* HTTP status code, if available.
|
|
136
|
-
*/
|
|
137
|
-
http_status_code: number | null;
|
|
138
|
-
|
|
139
|
-
url: string;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
125
|
/**
|
|
143
126
|
* Fetch result.
|
|
144
127
|
*/
|
|
@@ -146,7 +129,7 @@ export interface ExtractResponse {
|
|
|
146
129
|
/**
|
|
147
130
|
* Extract errors: requested URLs not in the results.
|
|
148
131
|
*/
|
|
149
|
-
errors: Array<ExtractError>;
|
|
132
|
+
errors: Array<TopLevelAPI.ExtractError>;
|
|
150
133
|
|
|
151
134
|
/**
|
|
152
135
|
* Extract request ID, e.g. `extract_cad0a6d2dec046bd95ae900527d880e7`
|
|
@@ -161,7 +144,7 @@ export interface ExtractResponse {
|
|
|
161
144
|
/**
|
|
162
145
|
* Usage metrics for the extract request.
|
|
163
146
|
*/
|
|
164
|
-
usage?: Array<UsageItem> | null;
|
|
147
|
+
usage?: Array<TopLevelAPI.UsageItem> | null;
|
|
165
148
|
|
|
166
149
|
/**
|
|
167
150
|
* Warnings for the extract request, if any.
|
|
@@ -199,28 +182,6 @@ export interface ExtractResult {
|
|
|
199
182
|
title?: string | null;
|
|
200
183
|
}
|
|
201
184
|
|
|
202
|
-
/**
|
|
203
|
-
* Policy for live fetching web results.
|
|
204
|
-
*/
|
|
205
|
-
export interface FetchPolicy {
|
|
206
|
-
/**
|
|
207
|
-
* If false, fallback to cached content older than max-age if live fetch fails or
|
|
208
|
-
* times out. If true, returns an error instead.
|
|
209
|
-
*/
|
|
210
|
-
disable_cache_fallback?: boolean;
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Maximum age of cached content in seconds to trigger a live fetch. Minimum value
|
|
214
|
-
* 600 seconds (10 minutes).
|
|
215
|
-
*/
|
|
216
|
-
max_age_seconds?: number | null;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Timeout in seconds for fetching live content if unavailable in cache.
|
|
220
|
-
*/
|
|
221
|
-
timeout_seconds?: number | null;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
185
|
/**
|
|
225
186
|
* Output for the Search API.
|
|
226
187
|
*/
|
|
@@ -238,7 +199,7 @@ export interface SearchResult {
|
|
|
238
199
|
/**
|
|
239
200
|
* Usage metrics for the search request.
|
|
240
201
|
*/
|
|
241
|
-
usage?: Array<UsageItem> | null;
|
|
202
|
+
usage?: Array<TopLevelAPI.UsageItem> | null;
|
|
242
203
|
|
|
243
204
|
/**
|
|
244
205
|
* Warnings for the search request, if any.
|
|
@@ -246,21 +207,6 @@ export interface SearchResult {
|
|
|
246
207
|
warnings?: Array<Shared.Warning> | null;
|
|
247
208
|
}
|
|
248
209
|
|
|
249
|
-
/**
|
|
250
|
-
* Usage item for a single operation.
|
|
251
|
-
*/
|
|
252
|
-
export interface UsageItem {
|
|
253
|
-
/**
|
|
254
|
-
* Count of the SKU.
|
|
255
|
-
*/
|
|
256
|
-
count: number;
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Name of the SKU.
|
|
260
|
-
*/
|
|
261
|
-
name: string;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
210
|
/**
|
|
265
211
|
* A single search result from the web search API.
|
|
266
212
|
*/
|
|
@@ -286,12 +232,24 @@ export interface WebSearchResult {
|
|
|
286
232
|
title?: string | null;
|
|
287
233
|
}
|
|
288
234
|
|
|
235
|
+
export type ExtractError = TopLevelAPI.ExtractError;
|
|
236
|
+
|
|
237
|
+
export type FetchPolicy = TopLevelAPI.FetchPolicy;
|
|
238
|
+
|
|
239
|
+
export type UsageItem = TopLevelAPI.UsageItem;
|
|
240
|
+
|
|
289
241
|
export interface BetaExtractParams {
|
|
290
242
|
/**
|
|
291
243
|
* Body param
|
|
292
244
|
*/
|
|
293
245
|
urls: Array<string>;
|
|
294
246
|
|
|
247
|
+
/**
|
|
248
|
+
* Body param: The model generating this request and consuming the results. Enables
|
|
249
|
+
* optimizations and tailors default settings for the model's capabilities.
|
|
250
|
+
*/
|
|
251
|
+
client_model?: string | null;
|
|
252
|
+
|
|
295
253
|
/**
|
|
296
254
|
* Body param: Include excerpts from each URL relevant to the search objective and
|
|
297
255
|
* queries. Note that if neither objective nor search_queries is provided, excerpts
|
|
@@ -302,7 +260,7 @@ export interface BetaExtractParams {
|
|
|
302
260
|
/**
|
|
303
261
|
* Body param: Policy for live fetching web results.
|
|
304
262
|
*/
|
|
305
|
-
fetch_policy?: FetchPolicy | null;
|
|
263
|
+
fetch_policy?: TopLevelAPI.FetchPolicy | null;
|
|
306
264
|
|
|
307
265
|
/**
|
|
308
266
|
* Body param: Include full content from each URL. Note that if neither objective
|
|
@@ -322,6 +280,13 @@ export interface BetaExtractParams {
|
|
|
322
280
|
*/
|
|
323
281
|
search_queries?: Array<string> | null;
|
|
324
282
|
|
|
283
|
+
/**
|
|
284
|
+
* Body param: Session identifier to track calls across separate search and extract
|
|
285
|
+
* calls, to be used as part of a larger task. Specifying it may give better
|
|
286
|
+
* contextual results for subsequent API calls.
|
|
287
|
+
*/
|
|
288
|
+
session_id?: string | null;
|
|
289
|
+
|
|
325
290
|
/**
|
|
326
291
|
* Header param: Optional header to specify the beta version(s) to enable.
|
|
327
292
|
*/
|
|
@@ -343,6 +308,12 @@ export namespace BetaExtractParams {
|
|
|
343
308
|
}
|
|
344
309
|
|
|
345
310
|
export interface BetaSearchParams {
|
|
311
|
+
/**
|
|
312
|
+
* Body param: The model generating this request and consuming the results. Enables
|
|
313
|
+
* optimizations and tailors default settings for the model's capabilities.
|
|
314
|
+
*/
|
|
315
|
+
client_model?: string | null;
|
|
316
|
+
|
|
346
317
|
/**
|
|
347
318
|
* Body param: Optional settings to configure excerpt generation.
|
|
348
319
|
*/
|
|
@@ -351,7 +322,12 @@ export interface BetaSearchParams {
|
|
|
351
322
|
/**
|
|
352
323
|
* Body param: Policy for live fetching web results.
|
|
353
324
|
*/
|
|
354
|
-
fetch_policy?: FetchPolicy | null;
|
|
325
|
+
fetch_policy?: TopLevelAPI.FetchPolicy | null;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Body param: ISO 3166-1 alpha-2 country code for geo-targeted search results.
|
|
329
|
+
*/
|
|
330
|
+
location?: string | null;
|
|
355
331
|
|
|
356
332
|
/**
|
|
357
333
|
* @deprecated Body param: DEPRECATED: Use `excerpts.max_chars_per_result` instead.
|
|
@@ -395,6 +371,13 @@ export interface BetaSearchParams {
|
|
|
395
371
|
*/
|
|
396
372
|
search_queries?: Array<string> | null;
|
|
397
373
|
|
|
374
|
+
/**
|
|
375
|
+
* Body param: Session identifier to track calls across separate search and extract
|
|
376
|
+
* calls, to be used as part of a larger task. Specifying it may give better
|
|
377
|
+
* contextual results for subsequent API calls.
|
|
378
|
+
*/
|
|
379
|
+
session_id?: string | null;
|
|
380
|
+
|
|
398
381
|
/**
|
|
399
382
|
* Body param: Source policy for web search results.
|
|
400
383
|
*
|
|
@@ -414,28 +397,28 @@ Beta.FindAll = FindAll;
|
|
|
414
397
|
export declare namespace Beta {
|
|
415
398
|
export {
|
|
416
399
|
type ExcerptSettings as ExcerptSettings,
|
|
417
|
-
type ExtractError as ExtractError,
|
|
418
400
|
type ExtractResponse as ExtractResponse,
|
|
419
401
|
type ExtractResult as ExtractResult,
|
|
420
|
-
type FetchPolicy as FetchPolicy,
|
|
421
402
|
type SearchResult as SearchResult,
|
|
422
|
-
type UsageItem as UsageItem,
|
|
423
403
|
type WebSearchResult as WebSearchResult,
|
|
404
|
+
type ExtractError as ExtractError,
|
|
405
|
+
type FetchPolicy as FetchPolicy,
|
|
406
|
+
type UsageItem as UsageItem,
|
|
424
407
|
type BetaExtractParams as BetaExtractParams,
|
|
425
408
|
type BetaSearchParams as BetaSearchParams,
|
|
426
409
|
};
|
|
427
410
|
|
|
428
411
|
export {
|
|
429
412
|
TaskRun as TaskRun,
|
|
413
|
+
type ParallelBeta as ParallelBeta,
|
|
414
|
+
type TaskRunEventsResponse as TaskRunEventsResponse,
|
|
430
415
|
type BetaRunInput as BetaRunInput,
|
|
431
416
|
type BetaTaskRunResult as BetaTaskRunResult,
|
|
432
|
-
type
|
|
417
|
+
type Webhook as Webhook,
|
|
433
418
|
type McpServer as McpServer,
|
|
434
419
|
type McpToolCall as McpToolCall,
|
|
435
|
-
type ParallelBeta as ParallelBeta,
|
|
436
420
|
type TaskRunEvent as TaskRunEvent,
|
|
437
|
-
type
|
|
438
|
-
type TaskRunEventsResponse as TaskRunEventsResponse,
|
|
421
|
+
type ErrorEvent as ErrorEvent,
|
|
439
422
|
type TaskRunCreateParams as TaskRunCreateParams,
|
|
440
423
|
type TaskRunResultParams as TaskRunResultParams,
|
|
441
424
|
};
|
|
@@ -455,6 +438,8 @@ export declare namespace Beta {
|
|
|
455
438
|
export {
|
|
456
439
|
FindAll as FindAll,
|
|
457
440
|
type FindAllCandidateMatchStatusEvent as FindAllCandidateMatchStatusEvent,
|
|
441
|
+
type FindAllCandidatesRequest as FindAllCandidatesRequest,
|
|
442
|
+
type FindAllCandidatesResponse as FindAllCandidatesResponse,
|
|
458
443
|
type FindAllEnrichInput as FindAllEnrichInput,
|
|
459
444
|
type FindAllExtendInput as FindAllExtendInput,
|
|
460
445
|
type FindAllRun as FindAllRun,
|
|
@@ -469,6 +454,7 @@ export declare namespace Beta {
|
|
|
469
454
|
type FindAllCreateParams as FindAllCreateParams,
|
|
470
455
|
type FindAllRetrieveParams as FindAllRetrieveParams,
|
|
471
456
|
type FindAllCancelParams as FindAllCancelParams,
|
|
457
|
+
type FindAllCandidatesParams as FindAllCandidatesParams,
|
|
472
458
|
type FindAllEnrichParams as FindAllEnrichParams,
|
|
473
459
|
type FindAllEventsParams as FindAllEventsParams,
|
|
474
460
|
type FindAllExtendParams as FindAllExtendParams,
|
|
@@ -26,6 +26,23 @@ export class FindAll extends APIResource {
|
|
|
26
26
|
* /v1beta/findall/runs/{findall_id}/events endpoint,
|
|
27
27
|
* - Or specifying a webhook with relevant event types during run creation to
|
|
28
28
|
* receive notifications.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const findallRun = await client.beta.findall.create({
|
|
33
|
+
* entity_type: 'entity_type',
|
|
34
|
+
* generator: 'base',
|
|
35
|
+
* match_conditions: [
|
|
36
|
+
* {
|
|
37
|
+
* description:
|
|
38
|
+
* "Company must have SOC2 Type II certification (not Type I). Look for evidence in: trust centers, security/compliance pages, audit reports, or press releases specifically mentioning 'SOC2 Type II'. If no explicit SOC2 Type II mention is found, consider requirement not satisfied.",
|
|
39
|
+
* name: 'name',
|
|
40
|
+
* },
|
|
41
|
+
* ],
|
|
42
|
+
* match_limit: 0,
|
|
43
|
+
* objective: 'objective',
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
29
46
|
*/
|
|
30
47
|
create(params: FindAllCreateParams, options?: RequestOptions): APIPromise<FindAllRun> {
|
|
31
48
|
const { betas, ...body } = params;
|
|
@@ -41,6 +58,13 @@ export class FindAll extends APIResource {
|
|
|
41
58
|
|
|
42
59
|
/**
|
|
43
60
|
* Retrieve a FindAll run.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const findallRun = await client.beta.findall.retrieve(
|
|
65
|
+
* 'findall_id',
|
|
66
|
+
* );
|
|
67
|
+
* ```
|
|
44
68
|
*/
|
|
45
69
|
retrieve(
|
|
46
70
|
findallID: string,
|
|
@@ -59,6 +83,13 @@ export class FindAll extends APIResource {
|
|
|
59
83
|
|
|
60
84
|
/**
|
|
61
85
|
* Cancel a FindAll run.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const response = await client.beta.findall.cancel(
|
|
90
|
+
* 'findall_id',
|
|
91
|
+
* );
|
|
92
|
+
* ```
|
|
62
93
|
*/
|
|
63
94
|
cancel(
|
|
64
95
|
findallID: string,
|
|
@@ -75,8 +106,49 @@ export class FindAll extends APIResource {
|
|
|
75
106
|
});
|
|
76
107
|
}
|
|
77
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Return ranked entity candidates matching a natural language objective.
|
|
111
|
+
*
|
|
112
|
+
* This endpoint performs a best-effort search optimised for low latency. For
|
|
113
|
+
* comprehensive match evaluation and enrichment, use the
|
|
114
|
+
* [FindAll API](https://docs.parallel.ai/findall-api/findall-quickstart).
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* const findallCandidatesResponse =
|
|
119
|
+
* await client.beta.findall.candidates({
|
|
120
|
+
* entity_type: 'company',
|
|
121
|
+
* objective: 'objective',
|
|
122
|
+
* });
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
candidates(body: FindAllCandidatesParams, options?: RequestOptions): APIPromise<FindAllCandidatesResponse> {
|
|
126
|
+
return this._client.post('/v1beta/findall/candidates', {
|
|
127
|
+
body,
|
|
128
|
+
...options,
|
|
129
|
+
headers: buildHeaders([{ 'parallel-beta': 'findall-2025-09-15' }, options?.headers]),
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
78
133
|
/**
|
|
79
134
|
* Add an enrichment to a FindAll run.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* const findallSchema = await client.beta.findall.enrich(
|
|
139
|
+
* 'findall_id',
|
|
140
|
+
* {
|
|
141
|
+
* output_schema: {
|
|
142
|
+
* json_schema: {
|
|
143
|
+
* additionalProperties: 'bar',
|
|
144
|
+
* properties: 'bar',
|
|
145
|
+
* required: 'bar',
|
|
146
|
+
* type: 'bar',
|
|
147
|
+
* },
|
|
148
|
+
* },
|
|
149
|
+
* },
|
|
150
|
+
* );
|
|
151
|
+
* ```
|
|
80
152
|
*/
|
|
81
153
|
enrich(
|
|
82
154
|
findallID: string,
|
|
@@ -101,6 +173,13 @@ export class FindAll extends APIResource {
|
|
|
101
173
|
* Optional event ID to resume from. timeout: Optional timeout in seconds. If None,
|
|
102
174
|
* keep connection alive as long as the run is going. If set, stop after specified
|
|
103
175
|
* duration.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```ts
|
|
179
|
+
* const response = await client.beta.findall.events(
|
|
180
|
+
* 'findall_id',
|
|
181
|
+
* );
|
|
182
|
+
* ```
|
|
104
183
|
*/
|
|
105
184
|
events(
|
|
106
185
|
findallID: string,
|
|
@@ -121,6 +200,14 @@ export class FindAll extends APIResource {
|
|
|
121
200
|
|
|
122
201
|
/**
|
|
123
202
|
* Extend a FindAll run by adding additional matches to the current match limit.
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```ts
|
|
206
|
+
* const findallSchema = await client.beta.findall.extend(
|
|
207
|
+
* 'findall_id',
|
|
208
|
+
* { additional_match_limit: 0 },
|
|
209
|
+
* );
|
|
210
|
+
* ```
|
|
124
211
|
*/
|
|
125
212
|
extend(
|
|
126
213
|
findallID: string,
|
|
@@ -145,6 +232,14 @@ export class FindAll extends APIResource {
|
|
|
145
232
|
*
|
|
146
233
|
* The generated specification serves as a suggested starting point and can be
|
|
147
234
|
* further customized by the user.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```ts
|
|
238
|
+
* const findallSchema = await client.beta.findall.ingest({
|
|
239
|
+
* objective:
|
|
240
|
+
* 'Find all AI companies that raised Series A funding in 2024',
|
|
241
|
+
* });
|
|
242
|
+
* ```
|
|
148
243
|
*/
|
|
149
244
|
ingest(params: FindAllIngestParams, options?: RequestOptions): APIPromise<FindAllSchema> {
|
|
150
245
|
const { betas, ...body } = params;
|
|
@@ -160,6 +255,13 @@ export class FindAll extends APIResource {
|
|
|
160
255
|
|
|
161
256
|
/**
|
|
162
257
|
* Retrieve the FindAll run result at the time of the request.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```ts
|
|
261
|
+
* const findallRunResult = await client.beta.findall.result(
|
|
262
|
+
* 'findall_id',
|
|
263
|
+
* );
|
|
264
|
+
* ```
|
|
163
265
|
*/
|
|
164
266
|
result(
|
|
165
267
|
findallID: string,
|
|
@@ -178,6 +280,13 @@ export class FindAll extends APIResource {
|
|
|
178
280
|
|
|
179
281
|
/**
|
|
180
282
|
* Get FindAll Run Schema
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* ```ts
|
|
286
|
+
* const findallSchema = await client.beta.findall.schema(
|
|
287
|
+
* 'findall_id',
|
|
288
|
+
* );
|
|
289
|
+
* ```
|
|
181
290
|
*/
|
|
182
291
|
schema(
|
|
183
292
|
findallID: string,
|
|
@@ -272,6 +381,56 @@ export namespace FindAllCandidateMatchStatusEvent {
|
|
|
272
381
|
}
|
|
273
382
|
}
|
|
274
383
|
|
|
384
|
+
export interface FindAllCandidatesRequest {
|
|
385
|
+
/**
|
|
386
|
+
* Type of entity to search for.
|
|
387
|
+
*/
|
|
388
|
+
entity_type: 'company' | 'people';
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Natural language description of target entities.
|
|
392
|
+
*/
|
|
393
|
+
objective: string;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Maximum number of candidates to return. Must be between 5 and 1000 (inclusive).
|
|
397
|
+
* May return fewer results. Defaults to 100.
|
|
398
|
+
*/
|
|
399
|
+
match_limit?: number;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export interface FindAllCandidatesResponse {
|
|
403
|
+
/**
|
|
404
|
+
* Candidate set request ID. Example:
|
|
405
|
+
* `candidate_set_cad0a6d2dec046bd95ae900527d880e7`
|
|
406
|
+
*/
|
|
407
|
+
candidate_set_id: string;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Ranked list of entity candidates.
|
|
411
|
+
*/
|
|
412
|
+
candidates: Array<FindAllCandidatesResponse.Candidate>;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export namespace FindAllCandidatesResponse {
|
|
416
|
+
export interface Candidate {
|
|
417
|
+
/**
|
|
418
|
+
* Descriptive text about the entity.
|
|
419
|
+
*/
|
|
420
|
+
description: string;
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Entity name.
|
|
424
|
+
*/
|
|
425
|
+
name: string;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Canonical URL for the entity.
|
|
429
|
+
*/
|
|
430
|
+
url: string;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
275
434
|
/**
|
|
276
435
|
* Input model for FindAll enrich.
|
|
277
436
|
*/
|
|
@@ -284,7 +443,7 @@ export interface FindAllEnrichInput {
|
|
|
284
443
|
/**
|
|
285
444
|
* List of MCP servers to use for the task.
|
|
286
445
|
*/
|
|
287
|
-
mcp_servers?: Array<
|
|
446
|
+
mcp_servers?: Array<TaskRunAPI.McpServer> | null;
|
|
288
447
|
|
|
289
448
|
/**
|
|
290
449
|
* Processor to use for the task.
|
|
@@ -413,7 +572,7 @@ export interface FindAllRunInput {
|
|
|
413
572
|
|
|
414
573
|
/**
|
|
415
574
|
* Maximum number of matches to find for this FindAll run. Must be between 5 and
|
|
416
|
-
* 1000 (inclusive).
|
|
575
|
+
* 1000 (inclusive). May return fewer results.
|
|
417
576
|
*/
|
|
418
577
|
match_limit: number;
|
|
419
578
|
|
|
@@ -435,7 +594,7 @@ export interface FindAllRunInput {
|
|
|
435
594
|
/**
|
|
436
595
|
* Webhooks for Task Runs.
|
|
437
596
|
*/
|
|
438
|
-
webhook?:
|
|
597
|
+
webhook?: TaskRunAPI.Webhook | null;
|
|
439
598
|
}
|
|
440
599
|
|
|
441
600
|
export namespace FindAllRunInput {
|
|
@@ -668,7 +827,7 @@ export type FindAllEventsResponse =
|
|
|
668
827
|
| FindAllSchemaUpdatedEvent
|
|
669
828
|
| FindAllRunStatusEvent
|
|
670
829
|
| FindAllCandidateMatchStatusEvent
|
|
671
|
-
|
|
|
830
|
+
| TaskRunAPI.ErrorEvent;
|
|
672
831
|
|
|
673
832
|
export interface FindAllCreateParams {
|
|
674
833
|
/**
|
|
@@ -688,7 +847,7 @@ export interface FindAllCreateParams {
|
|
|
688
847
|
|
|
689
848
|
/**
|
|
690
849
|
* Body param: Maximum number of matches to find for this FindAll run. Must be
|
|
691
|
-
* between 5 and 1000 (inclusive).
|
|
850
|
+
* between 5 and 1000 (inclusive). May return fewer results.
|
|
692
851
|
*/
|
|
693
852
|
match_limit: number;
|
|
694
853
|
|
|
@@ -710,7 +869,7 @@ export interface FindAllCreateParams {
|
|
|
710
869
|
/**
|
|
711
870
|
* Body param: Webhooks for Task Runs.
|
|
712
871
|
*/
|
|
713
|
-
webhook?:
|
|
872
|
+
webhook?: TaskRunAPI.Webhook | null;
|
|
714
873
|
|
|
715
874
|
/**
|
|
716
875
|
* Header param: Optional header to specify the beta version(s) to enable.
|
|
@@ -766,6 +925,24 @@ export interface FindAllCancelParams {
|
|
|
766
925
|
betas?: Array<BetaTaskRunAPI.ParallelBeta>;
|
|
767
926
|
}
|
|
768
927
|
|
|
928
|
+
export interface FindAllCandidatesParams {
|
|
929
|
+
/**
|
|
930
|
+
* Type of entity to search for.
|
|
931
|
+
*/
|
|
932
|
+
entity_type: 'company' | 'people';
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* Natural language description of target entities.
|
|
936
|
+
*/
|
|
937
|
+
objective: string;
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* Maximum number of candidates to return. Must be between 5 and 1000 (inclusive).
|
|
941
|
+
* May return fewer results. Defaults to 100.
|
|
942
|
+
*/
|
|
943
|
+
match_limit?: number;
|
|
944
|
+
}
|
|
945
|
+
|
|
769
946
|
export interface FindAllEnrichParams {
|
|
770
947
|
/**
|
|
771
948
|
* Body param: JSON schema for the enrichment output schema for the FindAll run.
|
|
@@ -775,7 +952,7 @@ export interface FindAllEnrichParams {
|
|
|
775
952
|
/**
|
|
776
953
|
* Body param: List of MCP servers to use for the task.
|
|
777
954
|
*/
|
|
778
|
-
mcp_servers?: Array<
|
|
955
|
+
mcp_servers?: Array<TaskRunAPI.McpServer> | null;
|
|
779
956
|
|
|
780
957
|
/**
|
|
781
958
|
* Body param: Processor to use for the task.
|
|
@@ -848,6 +1025,8 @@ export interface FindAllSchemaParams {
|
|
|
848
1025
|
export declare namespace FindAll {
|
|
849
1026
|
export {
|
|
850
1027
|
type FindAllCandidateMatchStatusEvent as FindAllCandidateMatchStatusEvent,
|
|
1028
|
+
type FindAllCandidatesRequest as FindAllCandidatesRequest,
|
|
1029
|
+
type FindAllCandidatesResponse as FindAllCandidatesResponse,
|
|
851
1030
|
type FindAllEnrichInput as FindAllEnrichInput,
|
|
852
1031
|
type FindAllExtendInput as FindAllExtendInput,
|
|
853
1032
|
type FindAllRun as FindAllRun,
|
|
@@ -862,6 +1041,7 @@ export declare namespace FindAll {
|
|
|
862
1041
|
type FindAllCreateParams as FindAllCreateParams,
|
|
863
1042
|
type FindAllRetrieveParams as FindAllRetrieveParams,
|
|
864
1043
|
type FindAllCancelParams as FindAllCancelParams,
|
|
1044
|
+
type FindAllCandidatesParams as FindAllCandidatesParams,
|
|
865
1045
|
type FindAllEnrichParams as FindAllEnrichParams,
|
|
866
1046
|
type FindAllEventsParams as FindAllEventsParams,
|
|
867
1047
|
type FindAllExtendParams as FindAllExtendParams,
|
|
@@ -5,6 +5,8 @@ export {
|
|
|
5
5
|
FindAll,
|
|
6
6
|
Findall,
|
|
7
7
|
type FindAllCandidateMatchStatusEvent,
|
|
8
|
+
type FindAllCandidatesRequest,
|
|
9
|
+
type FindAllCandidatesResponse,
|
|
8
10
|
type FindAllEnrichInput,
|
|
9
11
|
type FindAllExtendInput,
|
|
10
12
|
type FindAllRun,
|
|
@@ -19,6 +21,7 @@ export {
|
|
|
19
21
|
type FindAllCreateParams,
|
|
20
22
|
type FindAllRetrieveParams,
|
|
21
23
|
type FindAllCancelParams,
|
|
24
|
+
type FindAllCandidatesParams,
|
|
22
25
|
type FindAllEnrichParams,
|
|
23
26
|
type FindAllEventsParams,
|
|
24
27
|
type FindAllExtendParams,
|
|
@@ -60,15 +63,15 @@ export {
|
|
|
60
63
|
} from './task-group';
|
|
61
64
|
export {
|
|
62
65
|
TaskRun,
|
|
66
|
+
type ParallelBeta,
|
|
67
|
+
type TaskRunEventsResponse,
|
|
63
68
|
type BetaRunInput,
|
|
64
69
|
type BetaTaskRunResult,
|
|
65
|
-
type
|
|
70
|
+
type Webhook,
|
|
66
71
|
type McpServer,
|
|
67
72
|
type McpToolCall,
|
|
68
|
-
type ParallelBeta,
|
|
69
73
|
type TaskRunEvent,
|
|
70
|
-
type
|
|
71
|
-
type TaskRunEventsResponse,
|
|
74
|
+
type ErrorEvent,
|
|
72
75
|
type TaskRunCreateParams,
|
|
73
76
|
type TaskRunResultParams,
|
|
74
77
|
} from './task-run';
|