parallel-web 0.2.2 → 0.2.4

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/package.json +1 -1
  3. package/resources/beta/beta.d.mts +80 -33
  4. package/resources/beta/beta.d.mts.map +1 -1
  5. package/resources/beta/beta.d.ts +80 -33
  6. package/resources/beta/beta.d.ts.map +1 -1
  7. package/resources/beta/beta.js +7 -0
  8. package/resources/beta/beta.js.map +1 -1
  9. package/resources/beta/beta.mjs +7 -0
  10. package/resources/beta/beta.mjs.map +1 -1
  11. package/resources/beta/findall.d.mts +979 -0
  12. package/resources/beta/findall.d.mts.map +1 -0
  13. package/resources/beta/findall.d.ts +979 -0
  14. package/resources/beta/findall.d.ts.map +1 -0
  15. package/resources/beta/findall.js +155 -0
  16. package/resources/beta/findall.js.map +1 -0
  17. package/resources/beta/findall.mjs +151 -0
  18. package/resources/beta/findall.mjs.map +1 -0
  19. package/resources/beta/index.d.mts +1 -0
  20. package/resources/beta/index.d.mts.map +1 -1
  21. package/resources/beta/index.d.ts +1 -0
  22. package/resources/beta/index.d.ts.map +1 -1
  23. package/resources/beta/index.js +3 -1
  24. package/resources/beta/index.js.map +1 -1
  25. package/resources/beta/index.mjs +1 -0
  26. package/resources/beta/index.mjs.map +1 -1
  27. package/resources/beta/task-run.d.mts +1 -1
  28. package/resources/beta/task-run.d.mts.map +1 -1
  29. package/resources/beta/task-run.d.ts +1 -1
  30. package/resources/beta/task-run.d.ts.map +1 -1
  31. package/resources/shared.d.mts +6 -2
  32. package/resources/shared.d.mts.map +1 -1
  33. package/resources/shared.d.ts +6 -2
  34. package/resources/shared.d.ts.map +1 -1
  35. package/src/resources/beta/beta.ts +141 -33
  36. package/src/resources/beta/findall.ts +1295 -0
  37. package/src/resources/beta/index.ts +25 -0
  38. package/src/resources/beta/task-run.ts +2 -0
  39. package/src/resources/shared.ts +6 -2
  40. package/src/version.ts +1 -1
  41. package/version.d.mts +1 -1
  42. package/version.d.ts +1 -1
  43. package/version.js +1 -1
  44. package/version.mjs +1 -1
@@ -0,0 +1,1295 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as TaskRunAPI from '../task-run';
5
+ import * as BetaTaskRunAPI from './task-run';
6
+ import { APIPromise } from '../../core/api-promise';
7
+ import { Stream } from '../../core/streaming';
8
+ import { buildHeaders } from '../../internal/headers';
9
+ import { RequestOptions } from '../../internal/request-options';
10
+ import { path } from '../../internal/utils/path';
11
+
12
+ export class Findall extends APIResource {
13
+ /**
14
+ * Starts a FindAll run.
15
+ *
16
+ * This endpoint immediately returns a FindAll run object with status set to
17
+ * 'queued'. You can get the run result snapshot using the GET
18
+ * /v1beta/findall/runs/{findall_id}/result endpoint. You can track the progress of
19
+ * the run by:
20
+ *
21
+ * - Polling the status using the GET /v1beta/findall/runs/{findall_id} endpoint,
22
+ * - Subscribing to real-time updates via the
23
+ * /v1beta/findall/runs/{findall_id}/events endpoint,
24
+ * - Or specifying a webhook with relevant event types during run creation to
25
+ * receive notifications.
26
+ */
27
+ create(params: FindallCreateParams, options?: RequestOptions): APIPromise<FindallRun> {
28
+ const { betas, ...body } = params;
29
+ return this._client.post('/v1beta/findall/runs', {
30
+ body,
31
+ ...options,
32
+ headers: buildHeaders([
33
+ { 'parallel-beta': [...(betas ?? []), 'findall-2025-02-01'].toString() },
34
+ options?.headers,
35
+ ]),
36
+ });
37
+ }
38
+
39
+ /**
40
+ * Retrieve a FindAll run.
41
+ */
42
+ retrieve(
43
+ findallID: string,
44
+ params: FindallRetrieveParams | null | undefined = {},
45
+ options?: RequestOptions,
46
+ ): APIPromise<FindallRetrieveResponse> {
47
+ const { betas } = params ?? {};
48
+ return this._client.get(path`/v1beta/findall/runs/${findallID}`, {
49
+ ...options,
50
+ headers: buildHeaders([
51
+ { 'parallel-beta': [...(betas ?? []), 'findall-2025-02-01'].toString() },
52
+ options?.headers,
53
+ ]),
54
+ });
55
+ }
56
+
57
+ /**
58
+ * Cancel a FindAll run.
59
+ */
60
+ cancel(
61
+ findallID: string,
62
+ params: FindallCancelParams | null | undefined = {},
63
+ options?: RequestOptions,
64
+ ): APIPromise<unknown> {
65
+ const { betas } = params ?? {};
66
+ return this._client.post(path`/v1beta/findall/runs/${findallID}/cancel`, {
67
+ ...options,
68
+ headers: buildHeaders([
69
+ { 'parallel-beta': [...(betas ?? []), 'findall-2025-02-01'].toString() },
70
+ options?.headers,
71
+ ]),
72
+ });
73
+ }
74
+
75
+ /**
76
+ * Add an enrichment to a FindAll run.
77
+ */
78
+ enrich(
79
+ findallID: string,
80
+ params: FindallEnrichParams,
81
+ options?: RequestOptions,
82
+ ): APIPromise<FindallSchema> {
83
+ const { betas, ...body } = params;
84
+ return this._client.post(path`/v1beta/findall/runs/${findallID}/enrich`, {
85
+ body,
86
+ ...options,
87
+ headers: buildHeaders([
88
+ { 'parallel-beta': [...(betas ?? []), 'findall-2025-02-01'].toString() },
89
+ options?.headers,
90
+ ]),
91
+ });
92
+ }
93
+
94
+ /**
95
+ * Stream events from a FindAll run.
96
+ *
97
+ * Args: request: The Shapi request findall_id: The FindAll run ID last_event_id:
98
+ * Optional event ID to resume from. timeout: Optional timeout in seconds. If None,
99
+ * keep connection alive as long as the run is going. If set, stop after specified
100
+ * duration.
101
+ */
102
+ events(
103
+ findallID: string,
104
+ params: FindallEventsParams | undefined = {},
105
+ options?: RequestOptions,
106
+ ): APIPromise<Stream<FindallEventsResponse>> {
107
+ const { betas, ...query } = params ?? {};
108
+ return this._client.get(path`/v1beta/findall/runs/${findallID}/events`, {
109
+ query,
110
+ ...options,
111
+ headers: buildHeaders([
112
+ { 'parallel-beta': [...(betas ?? []), 'findall-2025-02-01'].toString(), Accept: 'text/event-stream' },
113
+ options?.headers,
114
+ ]),
115
+ stream: true,
116
+ }) as APIPromise<Stream<FindallEventsResponse>>;
117
+ }
118
+
119
+ /**
120
+ * Extend a FindAll run by adding additional matches to the current match limit.
121
+ */
122
+ extend(
123
+ findallID: string,
124
+ params: FindallExtendParams,
125
+ options?: RequestOptions,
126
+ ): APIPromise<FindallSchema> {
127
+ const { betas, ...body } = params;
128
+ return this._client.post(path`/v1beta/findall/runs/${findallID}/extend`, {
129
+ body,
130
+ ...options,
131
+ headers: buildHeaders([
132
+ { 'parallel-beta': [...(betas ?? []), 'findall-2025-02-01'].toString() },
133
+ options?.headers,
134
+ ]),
135
+ });
136
+ }
137
+
138
+ /**
139
+ * Transforms a natural language search objective into a structured FindAll spec.
140
+ *
141
+ * Note: Access to this endpoint requires the parallel-beta header.
142
+ *
143
+ * The generated specification serves as a suggested starting point and can be
144
+ * further customized by the user.
145
+ */
146
+ ingest(params: FindallIngestParams, options?: RequestOptions): APIPromise<FindallSchema> {
147
+ const { betas, ...body } = params;
148
+ return this._client.post('/v1beta/findall/ingest', {
149
+ body,
150
+ ...options,
151
+ headers: buildHeaders([
152
+ { 'parallel-beta': [...(betas ?? []), 'findall-2025-02-01'].toString() },
153
+ options?.headers,
154
+ ]),
155
+ });
156
+ }
157
+
158
+ /**
159
+ * Retrieve the FindAll run result at the time of the request.
160
+ */
161
+ result(
162
+ findallID: string,
163
+ params: FindallResultParams | null | undefined = {},
164
+ options?: RequestOptions,
165
+ ): APIPromise<FindallRunResult> {
166
+ const { betas } = params ?? {};
167
+ return this._client.get(path`/v1beta/findall/runs/${findallID}/result`, {
168
+ ...options,
169
+ headers: buildHeaders([
170
+ { 'parallel-beta': [...(betas ?? []), 'findall-2025-02-01'].toString() },
171
+ options?.headers,
172
+ ]),
173
+ });
174
+ }
175
+
176
+ /**
177
+ * Get FindAll Run Schema
178
+ */
179
+ schema(
180
+ findallID: string,
181
+ params: FindallSchemaParams | null | undefined = {},
182
+ options?: RequestOptions,
183
+ ): APIPromise<FindallSchema> {
184
+ const { betas } = params ?? {};
185
+ return this._client.get(path`/v1beta/findall/runs/${findallID}/schema`, {
186
+ ...options,
187
+ headers: buildHeaders([
188
+ { 'parallel-beta': [...(betas ?? []), 'findall-2025-02-01'].toString() },
189
+ options?.headers,
190
+ ]),
191
+ });
192
+ }
193
+ }
194
+
195
+ /**
196
+ * Event containing a candidate whose match status has changed.
197
+ */
198
+ export interface FindallCandidateMatchStatusEvent {
199
+ /**
200
+ * Candidate for a find all run that may end up as a match.
201
+ *
202
+ * Contains all the candidate's metadata and the output of the match conditions. A
203
+ * candidate is a match if all match conditions are satisfied.
204
+ */
205
+ data: FindallCandidateMatchStatusEvent.Data;
206
+
207
+ /**
208
+ * Unique event identifier for the event.
209
+ */
210
+ event_id: string;
211
+
212
+ /**
213
+ * Timestamp of the event.
214
+ */
215
+ timestamp: string;
216
+
217
+ /**
218
+ * Event type; one of findall.candidate.generated, findall.candidate.matched,
219
+ * findall.candidate.unmatched, findall.candidate.discarded,
220
+ * findall.candidate.enriched.
221
+ */
222
+ type:
223
+ | 'findall.candidate.generated'
224
+ | 'findall.candidate.matched'
225
+ | 'findall.candidate.unmatched'
226
+ | 'findall.candidate.discarded'
227
+ | 'findall.candidate.enriched';
228
+ }
229
+
230
+ export namespace FindallCandidateMatchStatusEvent {
231
+ /**
232
+ * Candidate for a find all run that may end up as a match.
233
+ *
234
+ * Contains all the candidate's metadata and the output of the match conditions. A
235
+ * candidate is a match if all match conditions are satisfied.
236
+ */
237
+ export interface Data {
238
+ /**
239
+ * ID of the candidate.
240
+ */
241
+ candidate_id: string;
242
+
243
+ /**
244
+ * Status of the candidate. One of generated, matched, unmatched, discarded.
245
+ */
246
+ match_status: 'generated' | 'matched' | 'unmatched' | 'discarded';
247
+
248
+ /**
249
+ * Name of the candidate.
250
+ */
251
+ name: string;
252
+
253
+ /**
254
+ * URL that provides context or details of the entity for disambiguation.
255
+ */
256
+ url: string;
257
+
258
+ /**
259
+ * List of FieldBasis objects supporting the output.
260
+ */
261
+ basis?: Array<TaskRunAPI.FieldBasis> | null;
262
+
263
+ /**
264
+ * Brief description of the entity that can help answer whether entity satisfies
265
+ * the query.
266
+ */
267
+ description?: string | null;
268
+
269
+ /**
270
+ * Results of the match condition evaluations for this candidate. This object
271
+ * contains the structured output that determines whether the candidate matches the
272
+ * overall FindAll objective.
273
+ */
274
+ output?: { [key: string]: unknown } | null;
275
+ }
276
+ }
277
+
278
+ /**
279
+ * Input model for FindAll enrich.
280
+ */
281
+ export interface FindallEnrichInput {
282
+ /**
283
+ * JSON schema for a task input or output.
284
+ */
285
+ output_schema: TaskRunAPI.JsonSchema;
286
+
287
+ /**
288
+ * List of MCP servers to use for the task.
289
+ */
290
+ mcp_servers?: Array<BetaTaskRunAPI.McpServer> | null;
291
+
292
+ /**
293
+ * Processor to use for the task.
294
+ */
295
+ processor?: string;
296
+ }
297
+
298
+ /**
299
+ * Input model for FindAll extend.
300
+ */
301
+ export interface FindallExtendInput {
302
+ /**
303
+ * Additional number of matches to find for this FindAll run. This value will be
304
+ * added to the current match limit to determine the new total match limit. Must be
305
+ * greater than 0.
306
+ */
307
+ additional_match_limit: number;
308
+ }
309
+
310
+ /**
311
+ * FindAll run object with status and metadata.
312
+ */
313
+ export interface FindallRun {
314
+ /**
315
+ * ID of the FindAll run.
316
+ */
317
+ findall_id: string;
318
+
319
+ /**
320
+ * Generator for the FindAll run.
321
+ */
322
+ generator: 'base' | 'core' | 'pro' | 'preview';
323
+
324
+ /**
325
+ * Status object for FindAll run.
326
+ */
327
+ status: FindallRun.Status;
328
+
329
+ /**
330
+ * Timestamp of the creation of the run, in RFC 3339 format.
331
+ */
332
+ created_at?: string | null;
333
+
334
+ /**
335
+ * Metadata for the FindAll run.
336
+ */
337
+ metadata?: { [key: string]: string | number | boolean } | null;
338
+
339
+ /**
340
+ * Timestamp of the latest modification to the FindAll run result, in RFC 3339
341
+ * format.
342
+ */
343
+ modified_at?: string | null;
344
+ }
345
+
346
+ export namespace FindallRun {
347
+ /**
348
+ * Status object for FindAll run.
349
+ */
350
+ export interface Status {
351
+ /**
352
+ * Whether the FindAll run is active
353
+ */
354
+ is_active: boolean;
355
+
356
+ /**
357
+ * Metrics object for FindAll run.
358
+ */
359
+ metrics: Status.Metrics;
360
+
361
+ /**
362
+ * Status of the FindAll run.
363
+ */
364
+ status: 'queued' | 'action_required' | 'running' | 'completed' | 'failed' | 'cancelling' | 'cancelled';
365
+
366
+ /**
367
+ * Reason for termination when FindAll run is in terminal status.
368
+ */
369
+ termination_reason?: string | null;
370
+ }
371
+
372
+ export namespace Status {
373
+ /**
374
+ * Metrics object for FindAll run.
375
+ */
376
+ export interface Metrics {
377
+ /**
378
+ * Number of candidates that were selected.
379
+ */
380
+ generated_candidates_count?: number;
381
+
382
+ /**
383
+ * Number of candidates that evaluated to matched.
384
+ */
385
+ matched_candidates_count?: number;
386
+ }
387
+ }
388
+ }
389
+
390
+ /**
391
+ * Input model for FindAll run.
392
+ */
393
+ export interface FindallRunInput {
394
+ /**
395
+ * Type of the entity for the FindAll run.
396
+ */
397
+ entity_type: string;
398
+
399
+ /**
400
+ * Generator for the FindAll run.
401
+ */
402
+ generator: 'base' | 'core' | 'pro' | 'preview';
403
+
404
+ /**
405
+ * List of match conditions for the FindAll run.
406
+ */
407
+ match_conditions: Array<FindallRunInput.MatchCondition>;
408
+
409
+ /**
410
+ * Maximum number of matches to find for this FindAll run.
411
+ */
412
+ match_limit: number;
413
+
414
+ /**
415
+ * Natural language objective of the FindAll run.
416
+ */
417
+ objective: string;
418
+
419
+ /**
420
+ * List of entity names/IDs to exclude from results.
421
+ */
422
+ exclude_list?: Array<FindallRunInput.ExcludeList> | null;
423
+
424
+ /**
425
+ * Metadata for the FindAll run.
426
+ */
427
+ metadata?: { [key: string]: string | number | boolean } | null;
428
+
429
+ /**
430
+ * Webhooks for Task Runs.
431
+ */
432
+ webhook?: BetaTaskRunAPI.Webhook | null;
433
+ }
434
+
435
+ export namespace FindallRunInput {
436
+ /**
437
+ * Match condition model for FindAll ingest.
438
+ */
439
+ export interface MatchCondition {
440
+ /**
441
+ * Detailed description of the match condition. Include as much specific
442
+ * information as possible to help improve the quality and accuracy of Find All run
443
+ * results.
444
+ */
445
+ description: string;
446
+
447
+ /**
448
+ * Name of the match condition.
449
+ */
450
+ name: string;
451
+ }
452
+
453
+ /**
454
+ * Exclude candidate input model for FindAll run.
455
+ */
456
+ export interface ExcludeList {
457
+ /**
458
+ * Name of the entity to exclude from results.
459
+ */
460
+ name: string;
461
+
462
+ /**
463
+ * URL of the entity to exclude from results.
464
+ */
465
+ url: string;
466
+ }
467
+ }
468
+
469
+ /**
470
+ * Complete FindAll search results.
471
+ *
472
+ * Represents a snapshot of a FindAll run, including run metadata and a list of
473
+ * candidate entities with their match status and details at the time the snapshot
474
+ * was taken.
475
+ */
476
+ export interface FindallRunResult {
477
+ /**
478
+ * All evaluated candidates at the time of the snapshot.
479
+ */
480
+ candidates: Array<FindallRunResult.Candidate>;
481
+
482
+ /**
483
+ * FindAll run object with status and metadata.
484
+ */
485
+ run: FindallRun;
486
+
487
+ /**
488
+ * ID of the last event of the run at the time of the request. This can be used to
489
+ * resume streaming from the last event.
490
+ */
491
+ last_event_id?: string | null;
492
+ }
493
+
494
+ export namespace FindallRunResult {
495
+ /**
496
+ * Candidate for a find all run that may end up as a match.
497
+ *
498
+ * Contains all the candidate's metadata and the output of the match conditions. A
499
+ * candidate is a match if all match conditions are satisfied.
500
+ */
501
+ export interface Candidate {
502
+ /**
503
+ * ID of the candidate.
504
+ */
505
+ candidate_id: string;
506
+
507
+ /**
508
+ * Status of the candidate. One of generated, matched, unmatched, discarded.
509
+ */
510
+ match_status: 'generated' | 'matched' | 'unmatched' | 'discarded';
511
+
512
+ /**
513
+ * Name of the candidate.
514
+ */
515
+ name: string;
516
+
517
+ /**
518
+ * URL that provides context or details of the entity for disambiguation.
519
+ */
520
+ url: string;
521
+
522
+ /**
523
+ * List of FieldBasis objects supporting the output.
524
+ */
525
+ basis?: Array<TaskRunAPI.FieldBasis> | null;
526
+
527
+ /**
528
+ * Brief description of the entity that can help answer whether entity satisfies
529
+ * the query.
530
+ */
531
+ description?: string | null;
532
+
533
+ /**
534
+ * Results of the match condition evaluations for this candidate. This object
535
+ * contains the structured output that determines whether the candidate matches the
536
+ * overall FindAll objective.
537
+ */
538
+ output?: { [key: string]: unknown } | null;
539
+ }
540
+ }
541
+
542
+ /**
543
+ * Event containing status update for FindAll run.
544
+ */
545
+ export interface FindallRunStatusEvent {
546
+ /**
547
+ * FindAll run object with status and metadata.
548
+ */
549
+ data: FindallRun;
550
+
551
+ /**
552
+ * Unique event identifier for the event.
553
+ */
554
+ event_id: string;
555
+
556
+ /**
557
+ * Timestamp of the event.
558
+ */
559
+ timestamp: string;
560
+
561
+ /**
562
+ * Event type; always 'findall.status'.
563
+ */
564
+ type: 'findall.status';
565
+ }
566
+
567
+ /**
568
+ * Response model for FindAll ingest.
569
+ */
570
+ export interface FindallSchema {
571
+ /**
572
+ * Type of the entity for the FindAll run.
573
+ */
574
+ entity_type: string;
575
+
576
+ /**
577
+ * List of match conditions for the FindAll run.
578
+ */
579
+ match_conditions: Array<FindallSchema.MatchCondition>;
580
+
581
+ /**
582
+ * Natural language objective of the FindAll run.
583
+ */
584
+ objective: string;
585
+
586
+ /**
587
+ * List of enrichment inputs for the FindAll run.
588
+ */
589
+ enrichments?: Array<FindallEnrichInput> | null;
590
+
591
+ /**
592
+ * The generator of the FindAll run.
593
+ */
594
+ generator?: 'base' | 'core' | 'pro' | 'preview';
595
+
596
+ /**
597
+ * Max number of candidates to evaluate
598
+ */
599
+ match_limit?: number | null;
600
+ }
601
+
602
+ export namespace FindallSchema {
603
+ /**
604
+ * Match condition model for FindAll ingest.
605
+ */
606
+ export interface MatchCondition {
607
+ /**
608
+ * Detailed description of the match condition. Include as much specific
609
+ * information as possible to help improve the quality and accuracy of Find All run
610
+ * results.
611
+ */
612
+ description: string;
613
+
614
+ /**
615
+ * Name of the match condition.
616
+ */
617
+ name: string;
618
+ }
619
+ }
620
+
621
+ /**
622
+ * Event containing full snapshot of FindAll run state.
623
+ */
624
+ export interface FindallSchemaUpdatedEvent {
625
+ /**
626
+ * Response model for FindAll ingest.
627
+ */
628
+ data: FindallSchema;
629
+
630
+ /**
631
+ * Unique event identifier for the event.
632
+ */
633
+ event_id: string;
634
+
635
+ /**
636
+ * Timestamp of the event.
637
+ */
638
+ timestamp: string;
639
+
640
+ /**
641
+ * Event type; always 'findall.schema.updated'.
642
+ */
643
+ type: 'findall.schema.updated';
644
+ }
645
+
646
+ /**
647
+ * Input model for FindAll ingest.
648
+ */
649
+ export interface IngestInput {
650
+ /**
651
+ * Natural language objective to create a FindAll run spec.
652
+ */
653
+ objective: string;
654
+ }
655
+
656
+ /**
657
+ * FindAll run object with status and metadata.
658
+ */
659
+ export type FindallRetrieveResponse = FindallRun | FindallRetrieveResponse.FindAllPollResponse;
660
+
661
+ export namespace FindallRetrieveResponse {
662
+ /**
663
+ * Response format for polling a FindAll run status.
664
+ */
665
+ export interface FindAllPollResponse {
666
+ /**
667
+ * Billing metrics for the run.
668
+ */
669
+ billing_metrics: FindAllPollResponse.BillingMetrics;
670
+
671
+ /**
672
+ * List of candidates being processed
673
+ */
674
+ candidates: Array<FindAllPollResponse.Candidate>;
675
+
676
+ /**
677
+ * List of enrichments derived from the query
678
+ */
679
+ enrichments: Array<FindAllPollResponse.Enrichment>;
680
+
681
+ /**
682
+ * List of filters derived from the query
683
+ */
684
+ filters: Array<FindAllPollResponse.Filter>;
685
+
686
+ /**
687
+ * True if the run is still processing candidates
688
+ */
689
+ is_active: boolean;
690
+
691
+ /**
692
+ * Max results processed for the run
693
+ */
694
+ max_results: number;
695
+
696
+ /**
697
+ * Query for the run
698
+ */
699
+ query: string;
700
+
701
+ /**
702
+ * List of entities which are fully processed
703
+ */
704
+ results: Array<FindAllPollResponse.Result>;
705
+
706
+ /**
707
+ * View model for the run.
708
+ */
709
+ spec: FindAllPollResponse.Spec;
710
+
711
+ /**
712
+ * Derived overall status (e.g., 'running', 'completed', 'failed')
713
+ */
714
+ status: string;
715
+
716
+ /**
717
+ * List of processing steps undertaken with their status
718
+ */
719
+ steps: Array<FindAllPollResponse.Step>;
720
+
721
+ /**
722
+ * Title of the run
723
+ */
724
+ title: string;
725
+
726
+ /**
727
+ * True if enrichments are still being processed
728
+ */
729
+ are_enrichments_active?: boolean;
730
+
731
+ /**
732
+ * Timestamp of the request
733
+ */
734
+ created_at?: string | null;
735
+
736
+ /**
737
+ * List of recommended enrichments that could be added
738
+ */
739
+ enrichment_recommendations?: Array<FindAllPollResponse.EnrichmentRecommendation>;
740
+
741
+ /**
742
+ * Timestamp of the last status update
743
+ */
744
+ modified_at?: string | null;
745
+
746
+ /**
747
+ * Number of web pages considered for this entity
748
+ */
749
+ pages_considered?: number | null;
750
+
751
+ /**
752
+ * Number of web pages read for this entity
753
+ */
754
+ pages_read?: number | null;
755
+ }
756
+
757
+ export namespace FindAllPollResponse {
758
+ /**
759
+ * Billing metrics for the run.
760
+ */
761
+ export interface BillingMetrics {
762
+ /**
763
+ * Number of enrichment cells processed
764
+ */
765
+ enrichment_cells: number;
766
+
767
+ /**
768
+ * Number of rows processed
769
+ */
770
+ rows_processed: number;
771
+
772
+ cost_mode?: 'lite' | 'base' | 'pro' | 'preview';
773
+ }
774
+
775
+ /**
776
+ * Simplified entity model for candidates.
777
+ */
778
+ export interface Candidate {
779
+ /**
780
+ * Unique entity identifier
781
+ */
782
+ entity_id: string;
783
+
784
+ /**
785
+ * Entity name
786
+ */
787
+ name: string;
788
+ }
789
+
790
+ /**
791
+ * Column model for filters and enrichments.
792
+ */
793
+ export interface Enrichment {
794
+ /**
795
+ * Human-readable description of the column
796
+ */
797
+ description: string;
798
+
799
+ /**
800
+ * Column identifier
801
+ */
802
+ name: string;
803
+
804
+ /**
805
+ * Column type ('enrichment' or 'filter')
806
+ */
807
+ type: string;
808
+
809
+ /**
810
+ * Status of the column ('running', 'done', 'failed')
811
+ */
812
+ status?: string | null;
813
+ }
814
+
815
+ /**
816
+ * Column model for filters and enrichments.
817
+ */
818
+ export interface Filter {
819
+ /**
820
+ * Human-readable description of the column
821
+ */
822
+ description: string;
823
+
824
+ /**
825
+ * Column identifier
826
+ */
827
+ name: string;
828
+
829
+ /**
830
+ * Column type ('enrichment' or 'filter')
831
+ */
832
+ type: string;
833
+
834
+ /**
835
+ * Status of the column ('running', 'done', 'failed')
836
+ */
837
+ status?: string | null;
838
+ }
839
+
840
+ /**
841
+ * Entity model for results and candidates.
842
+ */
843
+ export interface Result {
844
+ /**
845
+ * Unique entity identifier
846
+ */
847
+ entity_id: string;
848
+
849
+ /**
850
+ * Entity name
851
+ */
852
+ name: string;
853
+
854
+ /**
855
+ * Entity description if available
856
+ */
857
+ description?: string | null;
858
+
859
+ /**
860
+ * List of enrichment results
861
+ */
862
+ enrichment_results?: Array<Result.EnrichmentResult>;
863
+
864
+ /**
865
+ * List of filter results
866
+ */
867
+ filter_results?: Array<Result.FilterResult>;
868
+
869
+ /**
870
+ * Confidence score (positive real number)
871
+ */
872
+ score?: number | null;
873
+
874
+ /**
875
+ * Entity URL if available
876
+ */
877
+ url?: string | null;
878
+ }
879
+
880
+ export namespace Result {
881
+ /**
882
+ * Result model for filter and enrichment results.
883
+ */
884
+ export interface EnrichmentResult {
885
+ /**
886
+ * Name of column
887
+ */
888
+ key: string;
889
+
890
+ /**
891
+ * Result of column
892
+ */
893
+ value: string;
894
+
895
+ /**
896
+ * Space separated list of citation urls
897
+ */
898
+ citations?: string | null;
899
+
900
+ /**
901
+ * Confidence score (e.g. 'high', 'medium', 'low')
902
+ */
903
+ confidence?: string | null;
904
+
905
+ /**
906
+ * List of enhanced citations with title and excerpts
907
+ */
908
+ enhanced_citations?: Array<EnrichmentResult.EnhancedCitation>;
909
+
910
+ /**
911
+ * Reasoning behind the value
912
+ */
913
+ reasoning?: string | null;
914
+ }
915
+
916
+ export namespace EnrichmentResult {
917
+ /**
918
+ * Enhanced citation model with title, excerpts, and URL for UI.
919
+ */
920
+ export interface EnhancedCitation {
921
+ /**
922
+ * Citation URL
923
+ */
924
+ url: string;
925
+
926
+ /**
927
+ * List of relevant excerpts from the cited page
928
+ */
929
+ excerpts?: Array<string>;
930
+
931
+ /**
932
+ * Title of the cited page
933
+ */
934
+ title?: string | null;
935
+ }
936
+ }
937
+
938
+ /**
939
+ * Result model for filter and enrichment results.
940
+ */
941
+ export interface FilterResult {
942
+ /**
943
+ * Name of column
944
+ */
945
+ key: string;
946
+
947
+ /**
948
+ * Result of column
949
+ */
950
+ value: string;
951
+
952
+ /**
953
+ * Space separated list of citation urls
954
+ */
955
+ citations?: string | null;
956
+
957
+ /**
958
+ * Confidence score (e.g. 'high', 'medium', 'low')
959
+ */
960
+ confidence?: string | null;
961
+
962
+ /**
963
+ * List of enhanced citations with title and excerpts
964
+ */
965
+ enhanced_citations?: Array<FilterResult.EnhancedCitation>;
966
+
967
+ /**
968
+ * Reasoning behind the value
969
+ */
970
+ reasoning?: string | null;
971
+ }
972
+
973
+ export namespace FilterResult {
974
+ /**
975
+ * Enhanced citation model with title, excerpts, and URL for UI.
976
+ */
977
+ export interface EnhancedCitation {
978
+ /**
979
+ * Citation URL
980
+ */
981
+ url: string;
982
+
983
+ /**
984
+ * List of relevant excerpts from the cited page
985
+ */
986
+ excerpts?: Array<string>;
987
+
988
+ /**
989
+ * Title of the cited page
990
+ */
991
+ title?: string | null;
992
+ }
993
+ }
994
+ }
995
+
996
+ /**
997
+ * View model for the run.
998
+ */
999
+ export interface Spec {
1000
+ /**
1001
+ * List of columns in the view
1002
+ */
1003
+ columns: Array<Spec.Column>;
1004
+
1005
+ /**
1006
+ * Name of the view
1007
+ */
1008
+ name: string;
1009
+ }
1010
+
1011
+ export namespace Spec {
1012
+ /**
1013
+ * Column model for filters and enrichments.
1014
+ */
1015
+ export interface Column {
1016
+ /**
1017
+ * Human-readable description of the column
1018
+ */
1019
+ description: string;
1020
+
1021
+ /**
1022
+ * Column identifier
1023
+ */
1024
+ name: string;
1025
+
1026
+ /**
1027
+ * Column type ('enrichment' or 'filter')
1028
+ */
1029
+ type: string;
1030
+
1031
+ /**
1032
+ * Status of the column ('running', 'done', 'failed')
1033
+ */
1034
+ status?: string | null;
1035
+ }
1036
+ }
1037
+
1038
+ /**
1039
+ * Step model for tracking progress of FindAll operations.
1040
+ */
1041
+ export interface Step {
1042
+ /**
1043
+ * Human-readable description of the step
1044
+ */
1045
+ description: string;
1046
+
1047
+ /**
1048
+ * Step identifier
1049
+ */
1050
+ name: string;
1051
+
1052
+ /**
1053
+ * Current status of the step
1054
+ */
1055
+ status: string;
1056
+ }
1057
+
1058
+ /**
1059
+ * Enrichment recommendation model.
1060
+ */
1061
+ export interface EnrichmentRecommendation {
1062
+ /**
1063
+ * Recommended column name
1064
+ */
1065
+ column_name: string;
1066
+
1067
+ /**
1068
+ * Description of the recommended enrichment
1069
+ */
1070
+ description: string;
1071
+
1072
+ /**
1073
+ * Run ID that generated this recommendation
1074
+ */
1075
+ recommendation_run_id: string;
1076
+
1077
+ /**
1078
+ * Task ID that generated this recommendation
1079
+ */
1080
+ recommendation_task_id: string;
1081
+ }
1082
+ }
1083
+ }
1084
+
1085
+ export type FindallCancelResponse = unknown;
1086
+
1087
+ /**
1088
+ * Event containing full snapshot of FindAll run state.
1089
+ */
1090
+ export type FindallEventsResponse =
1091
+ | FindallSchemaUpdatedEvent
1092
+ | FindallRunStatusEvent
1093
+ | FindallCandidateMatchStatusEvent
1094
+ | BetaTaskRunAPI.ErrorEvent;
1095
+
1096
+ export interface FindallCreateParams {
1097
+ /**
1098
+ * Body param: Type of the entity for the FindAll run.
1099
+ */
1100
+ entity_type: string;
1101
+
1102
+ /**
1103
+ * Body param: Generator for the FindAll run.
1104
+ */
1105
+ generator: 'base' | 'core' | 'pro' | 'preview';
1106
+
1107
+ /**
1108
+ * Body param: List of match conditions for the FindAll run.
1109
+ */
1110
+ match_conditions: Array<FindallCreateParams.MatchCondition>;
1111
+
1112
+ /**
1113
+ * Body param: Maximum number of matches to find for this FindAll run.
1114
+ */
1115
+ match_limit: number;
1116
+
1117
+ /**
1118
+ * Body param: Natural language objective of the FindAll run.
1119
+ */
1120
+ objective: string;
1121
+
1122
+ /**
1123
+ * Body param: List of entity names/IDs to exclude from results.
1124
+ */
1125
+ exclude_list?: Array<FindallCreateParams.ExcludeList> | null;
1126
+
1127
+ /**
1128
+ * Body param: Metadata for the FindAll run.
1129
+ */
1130
+ metadata?: { [key: string]: string | number | boolean } | null;
1131
+
1132
+ /**
1133
+ * Body param: Webhooks for Task Runs.
1134
+ */
1135
+ webhook?: BetaTaskRunAPI.Webhook | null;
1136
+
1137
+ /**
1138
+ * Header param: Optional header to specify the beta version(s) to enable.
1139
+ */
1140
+ betas?: Array<BetaTaskRunAPI.ParallelBeta>;
1141
+ }
1142
+
1143
+ export namespace FindallCreateParams {
1144
+ /**
1145
+ * Match condition model for FindAll ingest.
1146
+ */
1147
+ export interface MatchCondition {
1148
+ /**
1149
+ * Detailed description of the match condition. Include as much specific
1150
+ * information as possible to help improve the quality and accuracy of Find All run
1151
+ * results.
1152
+ */
1153
+ description: string;
1154
+
1155
+ /**
1156
+ * Name of the match condition.
1157
+ */
1158
+ name: string;
1159
+ }
1160
+
1161
+ /**
1162
+ * Exclude candidate input model for FindAll run.
1163
+ */
1164
+ export interface ExcludeList {
1165
+ /**
1166
+ * Name of the entity to exclude from results.
1167
+ */
1168
+ name: string;
1169
+
1170
+ /**
1171
+ * URL of the entity to exclude from results.
1172
+ */
1173
+ url: string;
1174
+ }
1175
+ }
1176
+
1177
+ export interface FindallRetrieveParams {
1178
+ /**
1179
+ * Optional header to specify the beta version(s) to enable.
1180
+ */
1181
+ betas?: Array<BetaTaskRunAPI.ParallelBeta>;
1182
+ }
1183
+
1184
+ export interface FindallCancelParams {
1185
+ /**
1186
+ * Optional header to specify the beta version(s) to enable.
1187
+ */
1188
+ betas?: Array<BetaTaskRunAPI.ParallelBeta>;
1189
+ }
1190
+
1191
+ export interface FindallEnrichParams {
1192
+ /**
1193
+ * Body param: JSON schema for a task input or output.
1194
+ */
1195
+ output_schema: TaskRunAPI.JsonSchema;
1196
+
1197
+ /**
1198
+ * Body param: List of MCP servers to use for the task.
1199
+ */
1200
+ mcp_servers?: Array<BetaTaskRunAPI.McpServer> | null;
1201
+
1202
+ /**
1203
+ * Body param: Processor to use for the task.
1204
+ */
1205
+ processor?: string;
1206
+
1207
+ /**
1208
+ * Header param: Optional header to specify the beta version(s) to enable.
1209
+ */
1210
+ betas?: Array<BetaTaskRunAPI.ParallelBeta>;
1211
+ }
1212
+
1213
+ export interface FindallEventsParams {
1214
+ /**
1215
+ * Query param:
1216
+ */
1217
+ last_event_id?: string | null;
1218
+
1219
+ /**
1220
+ * Query param:
1221
+ */
1222
+ timeout?: number | null;
1223
+
1224
+ /**
1225
+ * Header param: Optional header to specify the beta version(s) to enable.
1226
+ */
1227
+ betas?: Array<BetaTaskRunAPI.ParallelBeta>;
1228
+ }
1229
+
1230
+ export interface FindallExtendParams {
1231
+ /**
1232
+ * Body param: Additional number of matches to find for this FindAll run. This
1233
+ * value will be added to the current match limit to determine the new total match
1234
+ * limit. Must be greater than 0.
1235
+ */
1236
+ additional_match_limit: number;
1237
+
1238
+ /**
1239
+ * Header param: Optional header to specify the beta version(s) to enable.
1240
+ */
1241
+ betas?: Array<BetaTaskRunAPI.ParallelBeta>;
1242
+ }
1243
+
1244
+ export interface FindallIngestParams {
1245
+ /**
1246
+ * Body param: Natural language objective to create a FindAll run spec.
1247
+ */
1248
+ objective: string;
1249
+
1250
+ /**
1251
+ * Header param: Optional header to specify the beta version(s) to enable.
1252
+ */
1253
+ betas?: Array<BetaTaskRunAPI.ParallelBeta>;
1254
+ }
1255
+
1256
+ export interface FindallResultParams {
1257
+ /**
1258
+ * Optional header to specify the beta version(s) to enable.
1259
+ */
1260
+ betas?: Array<BetaTaskRunAPI.ParallelBeta>;
1261
+ }
1262
+
1263
+ export interface FindallSchemaParams {
1264
+ /**
1265
+ * Optional header to specify the beta version(s) to enable.
1266
+ */
1267
+ betas?: Array<BetaTaskRunAPI.ParallelBeta>;
1268
+ }
1269
+
1270
+ export declare namespace Findall {
1271
+ export {
1272
+ type FindallCandidateMatchStatusEvent as FindallCandidateMatchStatusEvent,
1273
+ type FindallEnrichInput as FindallEnrichInput,
1274
+ type FindallExtendInput as FindallExtendInput,
1275
+ type FindallRun as FindallRun,
1276
+ type FindallRunInput as FindallRunInput,
1277
+ type FindallRunResult as FindallRunResult,
1278
+ type FindallRunStatusEvent as FindallRunStatusEvent,
1279
+ type FindallSchema as FindallSchema,
1280
+ type FindallSchemaUpdatedEvent as FindallSchemaUpdatedEvent,
1281
+ type IngestInput as IngestInput,
1282
+ type FindallRetrieveResponse as FindallRetrieveResponse,
1283
+ type FindallCancelResponse as FindallCancelResponse,
1284
+ type FindallEventsResponse as FindallEventsResponse,
1285
+ type FindallCreateParams as FindallCreateParams,
1286
+ type FindallRetrieveParams as FindallRetrieveParams,
1287
+ type FindallCancelParams as FindallCancelParams,
1288
+ type FindallEnrichParams as FindallEnrichParams,
1289
+ type FindallEventsParams as FindallEventsParams,
1290
+ type FindallExtendParams as FindallExtendParams,
1291
+ type FindallIngestParams as FindallIngestParams,
1292
+ type FindallResultParams as FindallResultParams,
1293
+ type FindallSchemaParams as FindallSchemaParams,
1294
+ };
1295
+ }