valyu-js 2.7.1 → 2.7.3
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/dist/index.d.mts +45 -2
- package/dist/index.d.ts +45 -2
- package/dist/index.js +63 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +63 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -207,7 +207,7 @@ type DeepResearchMode = "fast" | "standard" | "lite" | "heavy" | "max";
|
|
|
207
207
|
type DeepResearchStatus = "queued" | "running" | "awaiting_input" | "paused" | "completed" | "failed" | "cancelled";
|
|
208
208
|
type DeepResearchOutputFormat = "markdown" | "pdf" | "toon" | Record<string, any>;
|
|
209
209
|
type DeepResearchOutputType = "markdown" | "json" | "toon";
|
|
210
|
-
type ImageType = "chart" | "ai_generated";
|
|
210
|
+
type ImageType = "chart" | "ai_generated" | "screenshot";
|
|
211
211
|
type ChartType = "line" | "bar" | "area";
|
|
212
212
|
interface FileAttachment {
|
|
213
213
|
data: string;
|
|
@@ -261,6 +261,10 @@ interface DeepResearchSearchConfig {
|
|
|
261
261
|
category?: string;
|
|
262
262
|
countryCode?: CountryCode;
|
|
263
263
|
}
|
|
264
|
+
interface DeepResearchTools {
|
|
265
|
+
code_execution?: boolean;
|
|
266
|
+
screenshots?: boolean;
|
|
267
|
+
}
|
|
264
268
|
interface DeepResearchCreateOptions {
|
|
265
269
|
query?: string;
|
|
266
270
|
input?: string;
|
|
@@ -275,7 +279,9 @@ interface DeepResearchCreateOptions {
|
|
|
275
279
|
files?: FileAttachment[];
|
|
276
280
|
deliverables?: (string | Deliverable)[];
|
|
277
281
|
mcpServers?: MCPServerConfig[];
|
|
282
|
+
/** @deprecated Use tools.code_execution instead */
|
|
278
283
|
codeExecution?: boolean;
|
|
284
|
+
tools?: DeepResearchTools;
|
|
279
285
|
previousReports?: string[];
|
|
280
286
|
webhookUrl?: string;
|
|
281
287
|
alertEmail?: string | AlertEmailConfig;
|
|
@@ -331,6 +337,8 @@ interface ImageMetadata {
|
|
|
331
337
|
x_axis_label?: string;
|
|
332
338
|
y_axis_label?: string;
|
|
333
339
|
data_series?: ChartDataSeries[];
|
|
340
|
+
source_url?: string;
|
|
341
|
+
captured_at?: number;
|
|
334
342
|
}
|
|
335
343
|
interface DeepResearchSource {
|
|
336
344
|
title: string;
|
|
@@ -354,6 +362,12 @@ interface DeepResearchUsage {
|
|
|
354
362
|
compute_cost: number;
|
|
355
363
|
total_cost: number;
|
|
356
364
|
}
|
|
365
|
+
interface DeepResearchCostBreakdown {
|
|
366
|
+
task: number;
|
|
367
|
+
screenshots?: number;
|
|
368
|
+
code_execution?: number;
|
|
369
|
+
deliverables?: number;
|
|
370
|
+
}
|
|
357
371
|
interface DeepResearchCreateResponse {
|
|
358
372
|
success: boolean;
|
|
359
373
|
deepresearch_id?: string;
|
|
@@ -387,6 +401,8 @@ interface DeepResearchStatusResponse {
|
|
|
387
401
|
sources?: DeepResearchSource[];
|
|
388
402
|
cost?: number;
|
|
389
403
|
usage?: DeepResearchUsage;
|
|
404
|
+
cost_breakdown?: DeepResearchCostBreakdown;
|
|
405
|
+
tools?: DeepResearchTools;
|
|
390
406
|
batch_id?: string;
|
|
391
407
|
batch_task_id?: string;
|
|
392
408
|
hitl_config?: Record<string, boolean>;
|
|
@@ -451,6 +467,7 @@ interface WaitOptions {
|
|
|
451
467
|
pollInterval?: number;
|
|
452
468
|
maxWaitTime?: number;
|
|
453
469
|
onProgress?: (status: DeepResearchStatusResponse) => void;
|
|
470
|
+
onInteraction?: (interaction: Interaction) => Promise<Record<string, any> | null | undefined> | Record<string, any> | null | undefined;
|
|
454
471
|
}
|
|
455
472
|
interface StreamCallback {
|
|
456
473
|
onMessage?: (message: any) => void;
|
|
@@ -683,6 +700,16 @@ declare class Valyu {
|
|
|
683
700
|
togglePublic: (taskId: string, isPublic: boolean) => Promise<DeepResearchTogglePublicResponse>;
|
|
684
701
|
getAssets: (taskId: string, assetId: string, options?: DeepResearchGetAssetsOptions) => Promise<DeepResearchGetAssetsResponse>;
|
|
685
702
|
respond: (taskId: string, interactionId: string, response: Record<string, any>) => Promise<DeepResearchRespondResponse>;
|
|
703
|
+
respondPlanningQuestions: (taskId: string, interactionId: string, answers: {
|
|
704
|
+
question: string;
|
|
705
|
+
answer: string;
|
|
706
|
+
}[]) => Promise<DeepResearchRespondResponse>;
|
|
707
|
+
approvePlan: (taskId: string, interactionId: string, modifications?: string) => Promise<DeepResearchRespondResponse>;
|
|
708
|
+
respondSourceReview: (taskId: string, interactionId: string, options?: {
|
|
709
|
+
includedDomains?: string[];
|
|
710
|
+
excludedDomains?: string[];
|
|
711
|
+
}) => Promise<DeepResearchRespondResponse>;
|
|
712
|
+
approveOutline: (taskId: string, interactionId: string, modifications?: string) => Promise<DeepResearchRespondResponse>;
|
|
686
713
|
};
|
|
687
714
|
batch: {
|
|
688
715
|
create: (options?: CreateBatchOptions) => Promise<CreateBatchResponse>;
|
|
@@ -808,6 +835,22 @@ declare class Valyu {
|
|
|
808
835
|
* @param response - Response data matching the checkpoint type
|
|
809
836
|
*/
|
|
810
837
|
private _deepresearchRespond;
|
|
838
|
+
/**
|
|
839
|
+
* DeepResearch: Respond to a planning_questions checkpoint
|
|
840
|
+
*/
|
|
841
|
+
private _deepresearchRespondPlanningQuestions;
|
|
842
|
+
/**
|
|
843
|
+
* DeepResearch: Approve or request modifications to a plan_review checkpoint
|
|
844
|
+
*/
|
|
845
|
+
private _deepresearchApprovePlan;
|
|
846
|
+
/**
|
|
847
|
+
* DeepResearch: Respond to a source_review checkpoint
|
|
848
|
+
*/
|
|
849
|
+
private _deepresearchRespondSourceReview;
|
|
850
|
+
/**
|
|
851
|
+
* DeepResearch: Approve or request modifications to an outline_review checkpoint
|
|
852
|
+
*/
|
|
853
|
+
private _deepresearchApproveOutline;
|
|
811
854
|
/**
|
|
812
855
|
* DeepResearch: Cancel task
|
|
813
856
|
*/
|
|
@@ -941,4 +984,4 @@ declare class Valyu {
|
|
|
941
984
|
private _datasourcesCategories;
|
|
942
985
|
}
|
|
943
986
|
|
|
944
|
-
export { type AIUsage, type AddBatchTasksOptions, type AddBatchTasksResponse, type AlertEmailConfig, type AnswerErrorResponse, type AnswerOptions, type AnswerResponse, type AnswerStreamChunk, type AnswerStreamChunkType, type AnswerSuccessResponse, type BatchCounts, type BatchPagination, type BatchStatus, type BatchStatusResponse, type BatchTaskCreated, type BatchTaskInput, type BatchTaskListItem, type BatchWaitOptions, type CancelBatchResponse, type ChartDataPoint, type ChartDataSeries, type ChartType, type ContentResponseLength, type ContentResult, type ContentResultFailed, type ContentResultSuccess, type ContentsAsyncJobResponse, type ContentsJobResponse, type ContentsJobStatus, type ContentsJobWaitOptions, type ContentsOptions, type ContentsResponse, type Cost, type CountryCode, type CreateBatchOptions, type CreateBatchResponse, type Datasource, type DatasourceCategory, type DatasourceCategoryId, type DatasourceCoverage, type DatasourceModality, type DatasourcePricing, type DatasourcesCategoriesResponse, type DatasourcesListOptions, type DatasourcesListResponse, type DeepResearchBatch, type DeepResearchCancelResponse, type DeepResearchCreateOptions, type DeepResearchCreateResponse, type DeepResearchDeleteResponse, type DeepResearchGetAssetsOptions, type DeepResearchGetAssetsResponse, type DeepResearchListResponse, type DeepResearchMode, type DeepResearchOutputFormat, type DeepResearchRespondResponse, 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 HitlConfig, type ImageMetadata, type ImageType, type Interaction, type InteractionHistoryEntry, type InteractionType, type ListBatchTasksOptions, type ListBatchTasksResponse, type ListBatchesOptions, 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, verifyContentsWebhookSignature };
|
|
987
|
+
export { type AIUsage, type AddBatchTasksOptions, type AddBatchTasksResponse, type AlertEmailConfig, type AnswerErrorResponse, type AnswerOptions, type AnswerResponse, type AnswerStreamChunk, type AnswerStreamChunkType, type AnswerSuccessResponse, type BatchCounts, type BatchPagination, type BatchStatus, type BatchStatusResponse, type BatchTaskCreated, type BatchTaskInput, type BatchTaskListItem, type BatchWaitOptions, type CancelBatchResponse, type ChartDataPoint, type ChartDataSeries, type ChartType, type ContentResponseLength, type ContentResult, type ContentResultFailed, type ContentResultSuccess, type ContentsAsyncJobResponse, type ContentsJobResponse, type ContentsJobStatus, type ContentsJobWaitOptions, type ContentsOptions, type ContentsResponse, type Cost, type CountryCode, type CreateBatchOptions, type CreateBatchResponse, type Datasource, type DatasourceCategory, type DatasourceCategoryId, type DatasourceCoverage, type DatasourceModality, type DatasourcePricing, type DatasourcesCategoriesResponse, type DatasourcesListOptions, type DatasourcesListResponse, type DeepResearchBatch, type DeepResearchCancelResponse, type DeepResearchCostBreakdown, type DeepResearchCreateOptions, type DeepResearchCreateResponse, type DeepResearchDeleteResponse, type DeepResearchGetAssetsOptions, type DeepResearchGetAssetsResponse, type DeepResearchListResponse, type DeepResearchMode, type DeepResearchOutputFormat, type DeepResearchRespondResponse, type DeepResearchSearchConfig, type DeepResearchSource, type DeepResearchStatus, type DeepResearchStatusResponse, type DeepResearchTaskListItem, type DeepResearchTogglePublicResponse, type DeepResearchTools, type DeepResearchUpdateResponse, type DeepResearchUsage, type ExtractEffort, type ExtractionMetadata, type FeedbackResponse, type FeedbackSentiment, type FileAttachment, type HitlConfig, type ImageMetadata, type ImageType, type Interaction, type InteractionHistoryEntry, type InteractionType, type ListBatchTasksOptions, type ListBatchTasksResponse, type ListBatchesOptions, 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, verifyContentsWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -207,7 +207,7 @@ type DeepResearchMode = "fast" | "standard" | "lite" | "heavy" | "max";
|
|
|
207
207
|
type DeepResearchStatus = "queued" | "running" | "awaiting_input" | "paused" | "completed" | "failed" | "cancelled";
|
|
208
208
|
type DeepResearchOutputFormat = "markdown" | "pdf" | "toon" | Record<string, any>;
|
|
209
209
|
type DeepResearchOutputType = "markdown" | "json" | "toon";
|
|
210
|
-
type ImageType = "chart" | "ai_generated";
|
|
210
|
+
type ImageType = "chart" | "ai_generated" | "screenshot";
|
|
211
211
|
type ChartType = "line" | "bar" | "area";
|
|
212
212
|
interface FileAttachment {
|
|
213
213
|
data: string;
|
|
@@ -261,6 +261,10 @@ interface DeepResearchSearchConfig {
|
|
|
261
261
|
category?: string;
|
|
262
262
|
countryCode?: CountryCode;
|
|
263
263
|
}
|
|
264
|
+
interface DeepResearchTools {
|
|
265
|
+
code_execution?: boolean;
|
|
266
|
+
screenshots?: boolean;
|
|
267
|
+
}
|
|
264
268
|
interface DeepResearchCreateOptions {
|
|
265
269
|
query?: string;
|
|
266
270
|
input?: string;
|
|
@@ -275,7 +279,9 @@ interface DeepResearchCreateOptions {
|
|
|
275
279
|
files?: FileAttachment[];
|
|
276
280
|
deliverables?: (string | Deliverable)[];
|
|
277
281
|
mcpServers?: MCPServerConfig[];
|
|
282
|
+
/** @deprecated Use tools.code_execution instead */
|
|
278
283
|
codeExecution?: boolean;
|
|
284
|
+
tools?: DeepResearchTools;
|
|
279
285
|
previousReports?: string[];
|
|
280
286
|
webhookUrl?: string;
|
|
281
287
|
alertEmail?: string | AlertEmailConfig;
|
|
@@ -331,6 +337,8 @@ interface ImageMetadata {
|
|
|
331
337
|
x_axis_label?: string;
|
|
332
338
|
y_axis_label?: string;
|
|
333
339
|
data_series?: ChartDataSeries[];
|
|
340
|
+
source_url?: string;
|
|
341
|
+
captured_at?: number;
|
|
334
342
|
}
|
|
335
343
|
interface DeepResearchSource {
|
|
336
344
|
title: string;
|
|
@@ -354,6 +362,12 @@ interface DeepResearchUsage {
|
|
|
354
362
|
compute_cost: number;
|
|
355
363
|
total_cost: number;
|
|
356
364
|
}
|
|
365
|
+
interface DeepResearchCostBreakdown {
|
|
366
|
+
task: number;
|
|
367
|
+
screenshots?: number;
|
|
368
|
+
code_execution?: number;
|
|
369
|
+
deliverables?: number;
|
|
370
|
+
}
|
|
357
371
|
interface DeepResearchCreateResponse {
|
|
358
372
|
success: boolean;
|
|
359
373
|
deepresearch_id?: string;
|
|
@@ -387,6 +401,8 @@ interface DeepResearchStatusResponse {
|
|
|
387
401
|
sources?: DeepResearchSource[];
|
|
388
402
|
cost?: number;
|
|
389
403
|
usage?: DeepResearchUsage;
|
|
404
|
+
cost_breakdown?: DeepResearchCostBreakdown;
|
|
405
|
+
tools?: DeepResearchTools;
|
|
390
406
|
batch_id?: string;
|
|
391
407
|
batch_task_id?: string;
|
|
392
408
|
hitl_config?: Record<string, boolean>;
|
|
@@ -451,6 +467,7 @@ interface WaitOptions {
|
|
|
451
467
|
pollInterval?: number;
|
|
452
468
|
maxWaitTime?: number;
|
|
453
469
|
onProgress?: (status: DeepResearchStatusResponse) => void;
|
|
470
|
+
onInteraction?: (interaction: Interaction) => Promise<Record<string, any> | null | undefined> | Record<string, any> | null | undefined;
|
|
454
471
|
}
|
|
455
472
|
interface StreamCallback {
|
|
456
473
|
onMessage?: (message: any) => void;
|
|
@@ -683,6 +700,16 @@ declare class Valyu {
|
|
|
683
700
|
togglePublic: (taskId: string, isPublic: boolean) => Promise<DeepResearchTogglePublicResponse>;
|
|
684
701
|
getAssets: (taskId: string, assetId: string, options?: DeepResearchGetAssetsOptions) => Promise<DeepResearchGetAssetsResponse>;
|
|
685
702
|
respond: (taskId: string, interactionId: string, response: Record<string, any>) => Promise<DeepResearchRespondResponse>;
|
|
703
|
+
respondPlanningQuestions: (taskId: string, interactionId: string, answers: {
|
|
704
|
+
question: string;
|
|
705
|
+
answer: string;
|
|
706
|
+
}[]) => Promise<DeepResearchRespondResponse>;
|
|
707
|
+
approvePlan: (taskId: string, interactionId: string, modifications?: string) => Promise<DeepResearchRespondResponse>;
|
|
708
|
+
respondSourceReview: (taskId: string, interactionId: string, options?: {
|
|
709
|
+
includedDomains?: string[];
|
|
710
|
+
excludedDomains?: string[];
|
|
711
|
+
}) => Promise<DeepResearchRespondResponse>;
|
|
712
|
+
approveOutline: (taskId: string, interactionId: string, modifications?: string) => Promise<DeepResearchRespondResponse>;
|
|
686
713
|
};
|
|
687
714
|
batch: {
|
|
688
715
|
create: (options?: CreateBatchOptions) => Promise<CreateBatchResponse>;
|
|
@@ -808,6 +835,22 @@ declare class Valyu {
|
|
|
808
835
|
* @param response - Response data matching the checkpoint type
|
|
809
836
|
*/
|
|
810
837
|
private _deepresearchRespond;
|
|
838
|
+
/**
|
|
839
|
+
* DeepResearch: Respond to a planning_questions checkpoint
|
|
840
|
+
*/
|
|
841
|
+
private _deepresearchRespondPlanningQuestions;
|
|
842
|
+
/**
|
|
843
|
+
* DeepResearch: Approve or request modifications to a plan_review checkpoint
|
|
844
|
+
*/
|
|
845
|
+
private _deepresearchApprovePlan;
|
|
846
|
+
/**
|
|
847
|
+
* DeepResearch: Respond to a source_review checkpoint
|
|
848
|
+
*/
|
|
849
|
+
private _deepresearchRespondSourceReview;
|
|
850
|
+
/**
|
|
851
|
+
* DeepResearch: Approve or request modifications to an outline_review checkpoint
|
|
852
|
+
*/
|
|
853
|
+
private _deepresearchApproveOutline;
|
|
811
854
|
/**
|
|
812
855
|
* DeepResearch: Cancel task
|
|
813
856
|
*/
|
|
@@ -941,4 +984,4 @@ declare class Valyu {
|
|
|
941
984
|
private _datasourcesCategories;
|
|
942
985
|
}
|
|
943
986
|
|
|
944
|
-
export { type AIUsage, type AddBatchTasksOptions, type AddBatchTasksResponse, type AlertEmailConfig, type AnswerErrorResponse, type AnswerOptions, type AnswerResponse, type AnswerStreamChunk, type AnswerStreamChunkType, type AnswerSuccessResponse, type BatchCounts, type BatchPagination, type BatchStatus, type BatchStatusResponse, type BatchTaskCreated, type BatchTaskInput, type BatchTaskListItem, type BatchWaitOptions, type CancelBatchResponse, type ChartDataPoint, type ChartDataSeries, type ChartType, type ContentResponseLength, type ContentResult, type ContentResultFailed, type ContentResultSuccess, type ContentsAsyncJobResponse, type ContentsJobResponse, type ContentsJobStatus, type ContentsJobWaitOptions, type ContentsOptions, type ContentsResponse, type Cost, type CountryCode, type CreateBatchOptions, type CreateBatchResponse, type Datasource, type DatasourceCategory, type DatasourceCategoryId, type DatasourceCoverage, type DatasourceModality, type DatasourcePricing, type DatasourcesCategoriesResponse, type DatasourcesListOptions, type DatasourcesListResponse, type DeepResearchBatch, type DeepResearchCancelResponse, type DeepResearchCreateOptions, type DeepResearchCreateResponse, type DeepResearchDeleteResponse, type DeepResearchGetAssetsOptions, type DeepResearchGetAssetsResponse, type DeepResearchListResponse, type DeepResearchMode, type DeepResearchOutputFormat, type DeepResearchRespondResponse, 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 HitlConfig, type ImageMetadata, type ImageType, type Interaction, type InteractionHistoryEntry, type InteractionType, type ListBatchTasksOptions, type ListBatchTasksResponse, type ListBatchesOptions, 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, verifyContentsWebhookSignature };
|
|
987
|
+
export { type AIUsage, type AddBatchTasksOptions, type AddBatchTasksResponse, type AlertEmailConfig, type AnswerErrorResponse, type AnswerOptions, type AnswerResponse, type AnswerStreamChunk, type AnswerStreamChunkType, type AnswerSuccessResponse, type BatchCounts, type BatchPagination, type BatchStatus, type BatchStatusResponse, type BatchTaskCreated, type BatchTaskInput, type BatchTaskListItem, type BatchWaitOptions, type CancelBatchResponse, type ChartDataPoint, type ChartDataSeries, type ChartType, type ContentResponseLength, type ContentResult, type ContentResultFailed, type ContentResultSuccess, type ContentsAsyncJobResponse, type ContentsJobResponse, type ContentsJobStatus, type ContentsJobWaitOptions, type ContentsOptions, type ContentsResponse, type Cost, type CountryCode, type CreateBatchOptions, type CreateBatchResponse, type Datasource, type DatasourceCategory, type DatasourceCategoryId, type DatasourceCoverage, type DatasourceModality, type DatasourcePricing, type DatasourcesCategoriesResponse, type DatasourcesListOptions, type DatasourcesListResponse, type DeepResearchBatch, type DeepResearchCancelResponse, type DeepResearchCostBreakdown, type DeepResearchCreateOptions, type DeepResearchCreateResponse, type DeepResearchDeleteResponse, type DeepResearchGetAssetsOptions, type DeepResearchGetAssetsResponse, type DeepResearchListResponse, type DeepResearchMode, type DeepResearchOutputFormat, type DeepResearchRespondResponse, type DeepResearchSearchConfig, type DeepResearchSource, type DeepResearchStatus, type DeepResearchStatusResponse, type DeepResearchTaskListItem, type DeepResearchTogglePublicResponse, type DeepResearchTools, type DeepResearchUpdateResponse, type DeepResearchUsage, type ExtractEffort, type ExtractionMetadata, type FeedbackResponse, type FeedbackSentiment, type FileAttachment, type HitlConfig, type ImageMetadata, type ImageType, type Interaction, type InteractionHistoryEntry, type InteractionType, type ListBatchTasksOptions, type ListBatchTasksResponse, type ListBatchesOptions, 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, verifyContentsWebhookSignature };
|
package/dist/index.js
CHANGED
|
@@ -98,7 +98,11 @@ var Valyu = class {
|
|
|
98
98
|
delete: this._deepresearchDelete.bind(this),
|
|
99
99
|
togglePublic: this._deepresearchTogglePublic.bind(this),
|
|
100
100
|
getAssets: this._deepresearchGetAssets.bind(this),
|
|
101
|
-
respond: this._deepresearchRespond.bind(this)
|
|
101
|
+
respond: this._deepresearchRespond.bind(this),
|
|
102
|
+
respondPlanningQuestions: this._deepresearchRespondPlanningQuestions.bind(this),
|
|
103
|
+
approvePlan: this._deepresearchApprovePlan.bind(this),
|
|
104
|
+
respondSourceReview: this._deepresearchRespondSourceReview.bind(this),
|
|
105
|
+
approveOutline: this._deepresearchApproveOutline.bind(this)
|
|
102
106
|
};
|
|
103
107
|
this.batch = {
|
|
104
108
|
create: this._batchCreate.bind(this),
|
|
@@ -656,9 +660,13 @@ var Valyu = class {
|
|
|
656
660
|
query: queryValue,
|
|
657
661
|
mode: mode || "fast",
|
|
658
662
|
// API defaults to "standard", but we keep "fast" for backward compatibility
|
|
659
|
-
output_formats: options.outputFormats || ["markdown"]
|
|
660
|
-
code_execution: options.codeExecution !== false
|
|
663
|
+
output_formats: options.outputFormats || ["markdown"]
|
|
661
664
|
};
|
|
665
|
+
if (options.tools) {
|
|
666
|
+
payload.tools = options.tools;
|
|
667
|
+
} else if (options.codeExecution !== void 0) {
|
|
668
|
+
payload.code_execution = options.codeExecution;
|
|
669
|
+
}
|
|
662
670
|
if (options.strategy) payload.strategy = options.strategy;
|
|
663
671
|
if (options.researchStrategy)
|
|
664
672
|
payload.research_strategy = options.researchStrategy;
|
|
@@ -765,6 +773,19 @@ var Valyu = class {
|
|
|
765
773
|
if (options.onProgress) {
|
|
766
774
|
options.onProgress(status);
|
|
767
775
|
}
|
|
776
|
+
if ((status.status === "awaiting_input" || status.status === "paused") && status.interaction) {
|
|
777
|
+
if (options.onInteraction) {
|
|
778
|
+
const response = await options.onInteraction(status.interaction);
|
|
779
|
+
if (response) {
|
|
780
|
+
await this._deepresearchRespond(
|
|
781
|
+
taskId,
|
|
782
|
+
status.interaction.interaction_id,
|
|
783
|
+
response
|
|
784
|
+
);
|
|
785
|
+
continue;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
768
789
|
if (status.status === "completed" || status.status === "failed" || status.status === "cancelled") {
|
|
769
790
|
return status;
|
|
770
791
|
}
|
|
@@ -890,6 +911,45 @@ var Valyu = class {
|
|
|
890
911
|
};
|
|
891
912
|
}
|
|
892
913
|
}
|
|
914
|
+
/**
|
|
915
|
+
* DeepResearch: Respond to a planning_questions checkpoint
|
|
916
|
+
*/
|
|
917
|
+
async _deepresearchRespondPlanningQuestions(taskId, interactionId, answers) {
|
|
918
|
+
return this._deepresearchRespond(taskId, interactionId, {
|
|
919
|
+
answers
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* DeepResearch: Approve or request modifications to a plan_review checkpoint
|
|
924
|
+
*/
|
|
925
|
+
async _deepresearchApprovePlan(taskId, interactionId, modifications) {
|
|
926
|
+
const response = { approved: true };
|
|
927
|
+
if (modifications) {
|
|
928
|
+
response.approved = false;
|
|
929
|
+
response.modifications = modifications;
|
|
930
|
+
}
|
|
931
|
+
return this._deepresearchRespond(taskId, interactionId, response);
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* DeepResearch: Respond to a source_review checkpoint
|
|
935
|
+
*/
|
|
936
|
+
async _deepresearchRespondSourceReview(taskId, interactionId, options = {}) {
|
|
937
|
+
return this._deepresearchRespond(taskId, interactionId, {
|
|
938
|
+
included_domains: options.includedDomains || [],
|
|
939
|
+
excluded_domains: options.excludedDomains || []
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* DeepResearch: Approve or request modifications to an outline_review checkpoint
|
|
944
|
+
*/
|
|
945
|
+
async _deepresearchApproveOutline(taskId, interactionId, modifications) {
|
|
946
|
+
const response = { approved: true };
|
|
947
|
+
if (modifications) {
|
|
948
|
+
response.approved = false;
|
|
949
|
+
response.modifications = modifications;
|
|
950
|
+
}
|
|
951
|
+
return this._deepresearchRespond(taskId, interactionId, response);
|
|
952
|
+
}
|
|
893
953
|
/**
|
|
894
954
|
* DeepResearch: Cancel task
|
|
895
955
|
*/
|