valyu-js 2.3.2 → 2.4.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 CHANGED
@@ -58,7 +58,7 @@ The `deepresearch` namespace provides access to Valyu's AI-powered research agen
58
58
  // Create a research task
59
59
  const task = await valyu.deepresearch.create({
60
60
  input: "What are the latest developments in quantum computing?",
61
- model: "lite", // "lite" (fast, Haiku) or "heavy" (thorough, Sonnet)
61
+ model: "fast", // "fast" (Haiku) or "heavy" (thorough, Sonnet)
62
62
  outputFormats: ["markdown", "pdf"] // Output formats
63
63
  });
64
64
 
@@ -94,7 +94,7 @@ console.log(result.pdf_url); // PDF download URL
94
94
  | Parameter | Type | Default | Description |
95
95
  |-----------|------|---------|-------------|
96
96
  | `input` | `string` | *required* | Research query or task description |
97
- | `model` | `"lite" \| "heavy"` | `"lite"` | Research model - lite (fast) or heavy (thorough) |
97
+ | `model` | `"fast" \| "heavy"` | `"fast"` | Research model - fast or heavy (thorough) |
98
98
  | `outputFormats` | `("markdown" \| "pdf")[]` | `["markdown"]` | Output formats for the report |
99
99
  | `strategy` | `string` | - | Natural language research strategy |
100
100
  | `search` | `object` | - | Search configuration (type, sources) |
@@ -112,7 +112,7 @@ console.log(result.pdf_url); // PDF download URL
112
112
  ```javascript
113
113
  const task = await valyu.deepresearch.create({
114
114
  input: "Summarize recent AI safety research",
115
- model: "lite"
115
+ model: "fast"
116
116
  });
117
117
 
118
118
  const result = await valyu.deepresearch.wait(task.deepresearch_id);
@@ -160,6 +160,86 @@ const task = await valyu.deepresearch.create({
160
160
  });
161
161
  ```
162
162
 
163
+ ### Batch API
164
+
165
+ The `batch` namespace allows you to process multiple DeepResearch tasks efficiently. Perfect for running large-scale research operations.
166
+
167
+ ```javascript
168
+ // Create a batch
169
+ const batch = await valyu.batch.create({
170
+ name: "Q4 Research Batch",
171
+ model: "fast", // "fast", "standard", or "heavy"
172
+ outputFormats: ["markdown"]
173
+ });
174
+
175
+ // Add tasks to the batch
176
+ await valyu.batch.addTasks(batch.batch_id, {
177
+ tasks: [
178
+ { input: "What are the latest AI developments?" },
179
+ { input: "Analyze climate change trends" },
180
+ { input: "Review quantum computing progress" }
181
+ ]
182
+ });
183
+
184
+ // Wait for completion
185
+ const result = await valyu.batch.waitForCompletion(batch.batch_id, {
186
+ pollInterval: 10000, // Check every 10 seconds
187
+ onProgress: (batch) => {
188
+ console.log(`Progress: ${batch.counts.completed}/${batch.counts.total}`);
189
+ }
190
+ });
191
+
192
+ console.log('Total cost:', result.usage.total_cost);
193
+ ```
194
+
195
+ #### Batch Methods
196
+
197
+ | Method | Description |
198
+ |--------|-------------|
199
+ | `create(options?)` | Create a new batch |
200
+ | `status(batchId)` | Get batch status and task counts |
201
+ | `addTasks(batchId, options)` | Add tasks to a batch |
202
+ | `listTasks(batchId)` | List all tasks in a batch |
203
+ | `list()` | List all batches |
204
+ | `cancel(batchId)` | Cancel a batch and all pending tasks |
205
+ | `waitForCompletion(batchId, options?)` | Wait for batch completion with polling |
206
+
207
+ #### Batch Create Options
208
+
209
+ | Parameter | Type | Default | Description |
210
+ |-----------|------|---------|-------------|
211
+ | `name` | `string` | - | Optional batch name |
212
+ | `model` | `"fast" \| "standard" \| "heavy"` | `"standard"` | DeepResearch model for all tasks |
213
+ | `outputFormats` | `("markdown" \| "pdf")[]` | `["markdown"]` | Output formats |
214
+ | `search` | `object` | - | Search configuration for all tasks |
215
+ | `webhookUrl` | `string` | - | HTTPS URL for completion webhook |
216
+ | `metadata` | `object` | - | Custom metadata key-value pairs |
217
+
218
+ #### Batch Status Response
219
+
220
+ ```javascript
221
+ {
222
+ success: true,
223
+ batch: {
224
+ batch_id: "batch_xxx",
225
+ status: "processing", // "open", "processing", "completed", "cancelled"
226
+ counts: {
227
+ total: 10,
228
+ queued: 3,
229
+ running: 2,
230
+ completed: 4,
231
+ failed: 1,
232
+ cancelled: 0
233
+ },
234
+ usage: {
235
+ search_cost: 0.05,
236
+ ai_cost: 0.15,
237
+ total_cost: 0.20
238
+ }
239
+ }
240
+ }
241
+ ```
242
+
163
243
  ### Search Method
164
244
 
165
245
  The `search()` method is the core of the Valyu SDK. It accepts a query string as the first parameter, followed by optional configuration parameters.
package/dist/index.d.mts CHANGED
@@ -59,6 +59,7 @@ interface ContentsOptions {
59
59
  extractEffort?: ExtractEffort;
60
60
  responseLength?: ContentResponseLength;
61
61
  maxPriceDollars?: number;
62
+ screenshot?: boolean;
62
63
  }
63
64
  interface ContentResult {
64
65
  url: string;
@@ -66,10 +67,13 @@ interface ContentResult {
66
67
  content: string | number;
67
68
  length: number;
68
69
  source: string;
70
+ price: number;
71
+ description?: string;
69
72
  summary?: string | object;
70
73
  summary_success?: boolean;
71
74
  data_type?: string;
72
75
  image_url?: Record<string, string>;
76
+ screenshot_url?: string | null;
73
77
  citation?: string;
74
78
  }
75
79
  interface ContentsResponse {
@@ -352,6 +356,114 @@ interface ListOptions {
352
356
  apiKeyId: string;
353
357
  limit?: number;
354
358
  }
359
+ type BatchStatus = "open" | "processing" | "completed" | "completed_with_errors" | "cancelled";
360
+ interface BatchCounts {
361
+ total: number;
362
+ queued: number;
363
+ running: number;
364
+ completed: number;
365
+ failed: number;
366
+ cancelled: number;
367
+ }
368
+ interface BatchUsage {
369
+ search_cost: number;
370
+ contents_cost: number;
371
+ ai_cost: number;
372
+ total_cost: number;
373
+ }
374
+ interface DeepResearchBatch {
375
+ batch_id: string;
376
+ organisation_id: string;
377
+ api_key_id: string;
378
+ credit_id: string;
379
+ name?: string;
380
+ status: BatchStatus;
381
+ model: DeepResearchMode;
382
+ output_formats?: DeepResearchOutputFormat[];
383
+ search_params?: {
384
+ search_type?: "all" | "web" | "proprietary";
385
+ included_sources?: string[];
386
+ };
387
+ counts: BatchCounts;
388
+ usage: BatchUsage;
389
+ webhook_url?: string;
390
+ webhook_secret?: string;
391
+ created_at: number;
392
+ updated_at: number;
393
+ completed_at?: number;
394
+ metadata?: Record<string, string | number | boolean>;
395
+ }
396
+ interface CreateBatchOptions {
397
+ name?: string;
398
+ model?: DeepResearchMode;
399
+ outputFormats?: DeepResearchOutputFormat[];
400
+ search?: {
401
+ searchType?: "all" | "web" | "proprietary";
402
+ includedSources?: string[];
403
+ };
404
+ webhookUrl?: string;
405
+ metadata?: Record<string, string | number | boolean>;
406
+ }
407
+ interface BatchTaskInput {
408
+ id?: string;
409
+ input: string;
410
+ strategy?: string;
411
+ urls?: string[];
412
+ metadata?: Record<string, string | number | boolean>;
413
+ }
414
+ interface AddBatchTasksOptions {
415
+ tasks: BatchTaskInput[];
416
+ }
417
+ interface CreateBatchResponse {
418
+ success: boolean;
419
+ batch_id?: string;
420
+ status?: BatchStatus;
421
+ webhook_secret?: string;
422
+ error?: string;
423
+ }
424
+ interface BatchStatusResponse {
425
+ success: boolean;
426
+ batch?: DeepResearchBatch;
427
+ error?: string;
428
+ }
429
+ interface AddBatchTasksResponse {
430
+ success: boolean;
431
+ added_count?: number;
432
+ task_ids?: string[];
433
+ error?: string;
434
+ }
435
+ interface BatchTaskListItem {
436
+ deepresearch_id: string;
437
+ batch_id: string;
438
+ batch_task_id?: string;
439
+ query: string;
440
+ status: DeepResearchStatus;
441
+ created_at: number;
442
+ completed_at?: number;
443
+ error?: string;
444
+ }
445
+ interface ListBatchTasksResponse {
446
+ success: boolean;
447
+ tasks?: BatchTaskListItem[];
448
+ total_count?: number;
449
+ error?: string;
450
+ }
451
+ interface CancelBatchResponse {
452
+ success: boolean;
453
+ message?: string;
454
+ batch_id?: string;
455
+ error?: string;
456
+ }
457
+ interface ListBatchesResponse {
458
+ success: boolean;
459
+ batches?: DeepResearchBatch[];
460
+ error?: string;
461
+ }
462
+ interface BatchWaitOptions {
463
+ pollInterval?: number;
464
+ maxWaitTime?: number;
465
+ onProgress?: (batch: DeepResearchBatch) => void;
466
+ }
355
467
 
356
468
  declare class Valyu {
357
469
  private baseUrl;
@@ -367,6 +479,15 @@ declare class Valyu {
367
479
  delete: (taskId: string) => Promise<DeepResearchDeleteResponse>;
368
480
  togglePublic: (taskId: string, isPublic: boolean) => Promise<DeepResearchTogglePublicResponse>;
369
481
  };
482
+ batch: {
483
+ create: (options?: CreateBatchOptions) => Promise<CreateBatchResponse>;
484
+ status: (batchId: string) => Promise<BatchStatusResponse>;
485
+ addTasks: (batchId: string, options: AddBatchTasksOptions) => Promise<AddBatchTasksResponse>;
486
+ listTasks: (batchId: string) => Promise<ListBatchTasksResponse>;
487
+ cancel: (batchId: string) => Promise<CancelBatchResponse>;
488
+ list: () => Promise<ListBatchesResponse>;
489
+ waitForCompletion: (batchId: string, options?: BatchWaitOptions) => Promise<DeepResearchBatch>;
490
+ };
370
491
  constructor(apiKey?: string, baseUrl?: string);
371
492
  /**
372
493
  * Validates date format (YYYY-MM-DD)
@@ -418,9 +539,10 @@ declare class Valyu {
418
539
  * @param urls - Array of URLs to process (max 10)
419
540
  * @param options - Content extraction configuration options
420
541
  * @param options.summary - AI summary configuration: false (raw), true (auto), string (custom), or JSON schema
421
- * @param options.extractEffort - Extraction thoroughness: "normal" or "high"
542
+ * @param options.extractEffort - Extraction thoroughness: "normal", "high", or "auto"
422
543
  * @param options.responseLength - Content length per URL
423
544
  * @param options.maxPriceDollars - Maximum cost limit in USD
545
+ * @param options.screenshot - Request page screenshots (default: false)
424
546
  * @returns Promise resolving to content extraction results
425
547
  */
426
548
  contents(urls: string[], options?: ContentsOptions): Promise<ContentsResponse>;
@@ -460,6 +582,59 @@ declare class Valyu {
460
582
  * DeepResearch: Toggle public flag
461
583
  */
462
584
  private _deepresearchTogglePublic;
585
+ /**
586
+ * Batch: Create a new batch
587
+ * @param options - Batch configuration options
588
+ * @param options.name - Optional name for the batch
589
+ * @param options.model - DeepResearch mode: "fast", "standard", or "heavy" (default: "standard")
590
+ * @param options.outputFormats - Output formats for tasks (default: ["markdown"])
591
+ * @param options.search - Search configuration for all tasks in batch
592
+ * @param options.webhookUrl - Optional HTTPS URL for completion notification
593
+ * @param options.metadata - Optional metadata key-value pairs
594
+ * @returns Promise resolving to batch creation response with batch_id and webhook_secret
595
+ */
596
+ private _batchCreate;
597
+ /**
598
+ * Batch: Get batch status
599
+ * @param batchId - The batch ID to query
600
+ * @returns Promise resolving to batch status with counts and usage
601
+ */
602
+ private _batchStatus;
603
+ /**
604
+ * Batch: Add tasks to a batch
605
+ * @param batchId - The batch ID to add tasks to
606
+ * @param options - Task configuration options
607
+ * @param options.tasks - Array of task inputs
608
+ * @returns Promise resolving to response with added_count and task_ids
609
+ */
610
+ private _batchAddTasks;
611
+ /**
612
+ * Batch: List all tasks in a batch
613
+ * @param batchId - The batch ID to query
614
+ * @returns Promise resolving to list of tasks with their status
615
+ */
616
+ private _batchListTasks;
617
+ /**
618
+ * Batch: Cancel a batch and all its pending tasks
619
+ * @param batchId - The batch ID to cancel
620
+ * @returns Promise resolving to cancellation confirmation
621
+ */
622
+ private _batchCancel;
623
+ /**
624
+ * Batch: List all batches
625
+ * @returns Promise resolving to list of all batches
626
+ */
627
+ private _batchList;
628
+ /**
629
+ * Batch: Wait for batch completion with polling
630
+ * @param batchId - The batch ID to wait for
631
+ * @param options - Wait configuration options
632
+ * @param options.pollInterval - Polling interval in milliseconds (default: 10000)
633
+ * @param options.maxWaitTime - Maximum wait time in milliseconds (default: 7200000)
634
+ * @param options.onProgress - Callback for progress updates
635
+ * @returns Promise resolving to final batch status
636
+ */
637
+ private _batchWaitForCompletion;
463
638
  /**
464
639
  * Get AI-powered answers using the Valyu Answer API
465
640
  * @param query - The question or query string
@@ -500,4 +675,4 @@ declare class Valyu {
500
675
  private createErrorGenerator;
501
676
  }
502
677
 
503
- export { type AIUsage, type AnswerErrorResponse, type AnswerOptions, type AnswerResponse, type AnswerStreamChunk, type AnswerStreamChunkType, type AnswerSuccessResponse, type ChartDataPoint, type ChartDataSeries, type ChartType, type ContentResponseLength, type ContentResult, type ContentsOptions, type ContentsResponse, type Cost, type CountryCode, type DeepResearchCancelResponse, type DeepResearchCreateOptions, type DeepResearchCreateResponse, type DeepResearchDeleteResponse, type DeepResearchListResponse, type DeepResearchMode, type DeepResearchOutputFormat, type DeepResearchSearchConfig, type DeepResearchSource, type DeepResearchStatus, type DeepResearchStatusResponse, type DeepResearchTaskListItem, type DeepResearchTogglePublicResponse, type DeepResearchUpdateResponse, type DeepResearchUsage, type ExtractEffort, type ExtractionMetadata, type FeedbackResponse, type FeedbackSentiment, type FileAttachment, type ImageMetadata, type ImageType, type ListOptions, type MCPServerConfig, type Progress, type ResponseLength, type SearchMetadata, type SearchOptions, type SearchResponse, type SearchResult, type SearchType, type StreamCallback, Valyu, type WaitOptions };
678
+ export { type AIUsage, type AddBatchTasksOptions, type AddBatchTasksResponse, type AnswerErrorResponse, type AnswerOptions, type AnswerResponse, type AnswerStreamChunk, type AnswerStreamChunkType, type AnswerSuccessResponse, type BatchCounts, type BatchStatus, type BatchStatusResponse, type BatchTaskInput, type BatchTaskListItem, type BatchUsage, type BatchWaitOptions, type CancelBatchResponse, type ChartDataPoint, type ChartDataSeries, type ChartType, type ContentResponseLength, type ContentResult, type ContentsOptions, type ContentsResponse, type Cost, type CountryCode, type CreateBatchOptions, type CreateBatchResponse, type DeepResearchBatch, type DeepResearchCancelResponse, type DeepResearchCreateOptions, type DeepResearchCreateResponse, type DeepResearchDeleteResponse, type DeepResearchListResponse, type DeepResearchMode, type DeepResearchOutputFormat, type DeepResearchSearchConfig, type DeepResearchSource, type DeepResearchStatus, type DeepResearchStatusResponse, type DeepResearchTaskListItem, type DeepResearchTogglePublicResponse, type DeepResearchUpdateResponse, type DeepResearchUsage, type ExtractEffort, type ExtractionMetadata, type FeedbackResponse, type FeedbackSentiment, type FileAttachment, type ImageMetadata, type ImageType, type ListBatchTasksResponse, type ListBatchesResponse, type ListOptions, type MCPServerConfig, type Progress, type ResponseLength, type SearchMetadata, type SearchOptions, type SearchResponse, type SearchResult, type SearchType, type StreamCallback, Valyu, type WaitOptions };
package/dist/index.d.ts CHANGED
@@ -59,6 +59,7 @@ interface ContentsOptions {
59
59
  extractEffort?: ExtractEffort;
60
60
  responseLength?: ContentResponseLength;
61
61
  maxPriceDollars?: number;
62
+ screenshot?: boolean;
62
63
  }
63
64
  interface ContentResult {
64
65
  url: string;
@@ -66,10 +67,13 @@ interface ContentResult {
66
67
  content: string | number;
67
68
  length: number;
68
69
  source: string;
70
+ price: number;
71
+ description?: string;
69
72
  summary?: string | object;
70
73
  summary_success?: boolean;
71
74
  data_type?: string;
72
75
  image_url?: Record<string, string>;
76
+ screenshot_url?: string | null;
73
77
  citation?: string;
74
78
  }
75
79
  interface ContentsResponse {
@@ -352,6 +356,114 @@ interface ListOptions {
352
356
  apiKeyId: string;
353
357
  limit?: number;
354
358
  }
359
+ type BatchStatus = "open" | "processing" | "completed" | "completed_with_errors" | "cancelled";
360
+ interface BatchCounts {
361
+ total: number;
362
+ queued: number;
363
+ running: number;
364
+ completed: number;
365
+ failed: number;
366
+ cancelled: number;
367
+ }
368
+ interface BatchUsage {
369
+ search_cost: number;
370
+ contents_cost: number;
371
+ ai_cost: number;
372
+ total_cost: number;
373
+ }
374
+ interface DeepResearchBatch {
375
+ batch_id: string;
376
+ organisation_id: string;
377
+ api_key_id: string;
378
+ credit_id: string;
379
+ name?: string;
380
+ status: BatchStatus;
381
+ model: DeepResearchMode;
382
+ output_formats?: DeepResearchOutputFormat[];
383
+ search_params?: {
384
+ search_type?: "all" | "web" | "proprietary";
385
+ included_sources?: string[];
386
+ };
387
+ counts: BatchCounts;
388
+ usage: BatchUsage;
389
+ webhook_url?: string;
390
+ webhook_secret?: string;
391
+ created_at: number;
392
+ updated_at: number;
393
+ completed_at?: number;
394
+ metadata?: Record<string, string | number | boolean>;
395
+ }
396
+ interface CreateBatchOptions {
397
+ name?: string;
398
+ model?: DeepResearchMode;
399
+ outputFormats?: DeepResearchOutputFormat[];
400
+ search?: {
401
+ searchType?: "all" | "web" | "proprietary";
402
+ includedSources?: string[];
403
+ };
404
+ webhookUrl?: string;
405
+ metadata?: Record<string, string | number | boolean>;
406
+ }
407
+ interface BatchTaskInput {
408
+ id?: string;
409
+ input: string;
410
+ strategy?: string;
411
+ urls?: string[];
412
+ metadata?: Record<string, string | number | boolean>;
413
+ }
414
+ interface AddBatchTasksOptions {
415
+ tasks: BatchTaskInput[];
416
+ }
417
+ interface CreateBatchResponse {
418
+ success: boolean;
419
+ batch_id?: string;
420
+ status?: BatchStatus;
421
+ webhook_secret?: string;
422
+ error?: string;
423
+ }
424
+ interface BatchStatusResponse {
425
+ success: boolean;
426
+ batch?: DeepResearchBatch;
427
+ error?: string;
428
+ }
429
+ interface AddBatchTasksResponse {
430
+ success: boolean;
431
+ added_count?: number;
432
+ task_ids?: string[];
433
+ error?: string;
434
+ }
435
+ interface BatchTaskListItem {
436
+ deepresearch_id: string;
437
+ batch_id: string;
438
+ batch_task_id?: string;
439
+ query: string;
440
+ status: DeepResearchStatus;
441
+ created_at: number;
442
+ completed_at?: number;
443
+ error?: string;
444
+ }
445
+ interface ListBatchTasksResponse {
446
+ success: boolean;
447
+ tasks?: BatchTaskListItem[];
448
+ total_count?: number;
449
+ error?: string;
450
+ }
451
+ interface CancelBatchResponse {
452
+ success: boolean;
453
+ message?: string;
454
+ batch_id?: string;
455
+ error?: string;
456
+ }
457
+ interface ListBatchesResponse {
458
+ success: boolean;
459
+ batches?: DeepResearchBatch[];
460
+ error?: string;
461
+ }
462
+ interface BatchWaitOptions {
463
+ pollInterval?: number;
464
+ maxWaitTime?: number;
465
+ onProgress?: (batch: DeepResearchBatch) => void;
466
+ }
355
467
 
356
468
  declare class Valyu {
357
469
  private baseUrl;
@@ -367,6 +479,15 @@ declare class Valyu {
367
479
  delete: (taskId: string) => Promise<DeepResearchDeleteResponse>;
368
480
  togglePublic: (taskId: string, isPublic: boolean) => Promise<DeepResearchTogglePublicResponse>;
369
481
  };
482
+ batch: {
483
+ create: (options?: CreateBatchOptions) => Promise<CreateBatchResponse>;
484
+ status: (batchId: string) => Promise<BatchStatusResponse>;
485
+ addTasks: (batchId: string, options: AddBatchTasksOptions) => Promise<AddBatchTasksResponse>;
486
+ listTasks: (batchId: string) => Promise<ListBatchTasksResponse>;
487
+ cancel: (batchId: string) => Promise<CancelBatchResponse>;
488
+ list: () => Promise<ListBatchesResponse>;
489
+ waitForCompletion: (batchId: string, options?: BatchWaitOptions) => Promise<DeepResearchBatch>;
490
+ };
370
491
  constructor(apiKey?: string, baseUrl?: string);
371
492
  /**
372
493
  * Validates date format (YYYY-MM-DD)
@@ -418,9 +539,10 @@ declare class Valyu {
418
539
  * @param urls - Array of URLs to process (max 10)
419
540
  * @param options - Content extraction configuration options
420
541
  * @param options.summary - AI summary configuration: false (raw), true (auto), string (custom), or JSON schema
421
- * @param options.extractEffort - Extraction thoroughness: "normal" or "high"
542
+ * @param options.extractEffort - Extraction thoroughness: "normal", "high", or "auto"
422
543
  * @param options.responseLength - Content length per URL
423
544
  * @param options.maxPriceDollars - Maximum cost limit in USD
545
+ * @param options.screenshot - Request page screenshots (default: false)
424
546
  * @returns Promise resolving to content extraction results
425
547
  */
426
548
  contents(urls: string[], options?: ContentsOptions): Promise<ContentsResponse>;
@@ -460,6 +582,59 @@ declare class Valyu {
460
582
  * DeepResearch: Toggle public flag
461
583
  */
462
584
  private _deepresearchTogglePublic;
585
+ /**
586
+ * Batch: Create a new batch
587
+ * @param options - Batch configuration options
588
+ * @param options.name - Optional name for the batch
589
+ * @param options.model - DeepResearch mode: "fast", "standard", or "heavy" (default: "standard")
590
+ * @param options.outputFormats - Output formats for tasks (default: ["markdown"])
591
+ * @param options.search - Search configuration for all tasks in batch
592
+ * @param options.webhookUrl - Optional HTTPS URL for completion notification
593
+ * @param options.metadata - Optional metadata key-value pairs
594
+ * @returns Promise resolving to batch creation response with batch_id and webhook_secret
595
+ */
596
+ private _batchCreate;
597
+ /**
598
+ * Batch: Get batch status
599
+ * @param batchId - The batch ID to query
600
+ * @returns Promise resolving to batch status with counts and usage
601
+ */
602
+ private _batchStatus;
603
+ /**
604
+ * Batch: Add tasks to a batch
605
+ * @param batchId - The batch ID to add tasks to
606
+ * @param options - Task configuration options
607
+ * @param options.tasks - Array of task inputs
608
+ * @returns Promise resolving to response with added_count and task_ids
609
+ */
610
+ private _batchAddTasks;
611
+ /**
612
+ * Batch: List all tasks in a batch
613
+ * @param batchId - The batch ID to query
614
+ * @returns Promise resolving to list of tasks with their status
615
+ */
616
+ private _batchListTasks;
617
+ /**
618
+ * Batch: Cancel a batch and all its pending tasks
619
+ * @param batchId - The batch ID to cancel
620
+ * @returns Promise resolving to cancellation confirmation
621
+ */
622
+ private _batchCancel;
623
+ /**
624
+ * Batch: List all batches
625
+ * @returns Promise resolving to list of all batches
626
+ */
627
+ private _batchList;
628
+ /**
629
+ * Batch: Wait for batch completion with polling
630
+ * @param batchId - The batch ID to wait for
631
+ * @param options - Wait configuration options
632
+ * @param options.pollInterval - Polling interval in milliseconds (default: 10000)
633
+ * @param options.maxWaitTime - Maximum wait time in milliseconds (default: 7200000)
634
+ * @param options.onProgress - Callback for progress updates
635
+ * @returns Promise resolving to final batch status
636
+ */
637
+ private _batchWaitForCompletion;
463
638
  /**
464
639
  * Get AI-powered answers using the Valyu Answer API
465
640
  * @param query - The question or query string
@@ -500,4 +675,4 @@ declare class Valyu {
500
675
  private createErrorGenerator;
501
676
  }
502
677
 
503
- export { type AIUsage, type AnswerErrorResponse, type AnswerOptions, type AnswerResponse, type AnswerStreamChunk, type AnswerStreamChunkType, type AnswerSuccessResponse, type ChartDataPoint, type ChartDataSeries, type ChartType, type ContentResponseLength, type ContentResult, type ContentsOptions, type ContentsResponse, type Cost, type CountryCode, type DeepResearchCancelResponse, type DeepResearchCreateOptions, type DeepResearchCreateResponse, type DeepResearchDeleteResponse, type DeepResearchListResponse, type DeepResearchMode, type DeepResearchOutputFormat, type DeepResearchSearchConfig, type DeepResearchSource, type DeepResearchStatus, type DeepResearchStatusResponse, type DeepResearchTaskListItem, type DeepResearchTogglePublicResponse, type DeepResearchUpdateResponse, type DeepResearchUsage, type ExtractEffort, type ExtractionMetadata, type FeedbackResponse, type FeedbackSentiment, type FileAttachment, type ImageMetadata, type ImageType, type ListOptions, type MCPServerConfig, type Progress, type ResponseLength, type SearchMetadata, type SearchOptions, type SearchResponse, type SearchResult, type SearchType, type StreamCallback, Valyu, type WaitOptions };
678
+ export { type AIUsage, type AddBatchTasksOptions, type AddBatchTasksResponse, type AnswerErrorResponse, type AnswerOptions, type AnswerResponse, type AnswerStreamChunk, type AnswerStreamChunkType, type AnswerSuccessResponse, type BatchCounts, type BatchStatus, type BatchStatusResponse, type BatchTaskInput, type BatchTaskListItem, type BatchUsage, type BatchWaitOptions, type CancelBatchResponse, type ChartDataPoint, type ChartDataSeries, type ChartType, type ContentResponseLength, type ContentResult, type ContentsOptions, type ContentsResponse, type Cost, type CountryCode, type CreateBatchOptions, type CreateBatchResponse, type DeepResearchBatch, type DeepResearchCancelResponse, type DeepResearchCreateOptions, type DeepResearchCreateResponse, type DeepResearchDeleteResponse, type DeepResearchListResponse, type DeepResearchMode, type DeepResearchOutputFormat, type DeepResearchSearchConfig, type DeepResearchSource, type DeepResearchStatus, type DeepResearchStatusResponse, type DeepResearchTaskListItem, type DeepResearchTogglePublicResponse, type DeepResearchUpdateResponse, type DeepResearchUsage, type ExtractEffort, type ExtractionMetadata, type FeedbackResponse, type FeedbackSentiment, type FileAttachment, type ImageMetadata, type ImageType, type ListBatchTasksResponse, type ListBatchesResponse, type ListOptions, type MCPServerConfig, type Progress, type ResponseLength, type SearchMetadata, type SearchOptions, type SearchResponse, type SearchResult, type SearchType, type StreamCallback, Valyu, type WaitOptions };