exa-js 2.6.0 → 2.7.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 +8 -0
- package/dist/index.d.mts +48 -7
- package/dist/index.d.ts +48 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,6 +76,14 @@ const deepResult = await exa.search("Who leads OpenAI's safety team?", {
|
|
|
76
76
|
console.log(deepResult.output?.content);
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
+
Deep `outputSchema` modes:
|
|
80
|
+
- `type: "text"`: return plain text in `output.content` (optionally guided by `description`)
|
|
81
|
+
- `type: "object"`: return structured JSON in `output.content`
|
|
82
|
+
|
|
83
|
+
For `type: "object"`, deep search currently enforces:
|
|
84
|
+
- max nesting depth: `2`
|
|
85
|
+
- max total properties: `10`
|
|
86
|
+
|
|
79
87
|
Deep search variants:
|
|
80
88
|
- `deep`: light mode
|
|
81
89
|
- `deep-reasoning`: base reasoning mode
|
package/dist/index.d.mts
CHANGED
|
@@ -3095,6 +3095,38 @@ type BaseRegularSearchOptions = BaseSearchOptions & {
|
|
|
3095
3095
|
useAutoprompt?: boolean;
|
|
3096
3096
|
};
|
|
3097
3097
|
type DeepSearchType = "deep" | "deep-reasoning" | "deep-max";
|
|
3098
|
+
/**
|
|
3099
|
+
* Deep search output schema mode for plain text responses.
|
|
3100
|
+
*/
|
|
3101
|
+
type DeepTextOutputSchema = {
|
|
3102
|
+
type: "text";
|
|
3103
|
+
/**
|
|
3104
|
+
* Optional formatting guidance for text output.
|
|
3105
|
+
*/
|
|
3106
|
+
description?: string;
|
|
3107
|
+
};
|
|
3108
|
+
/**
|
|
3109
|
+
* Deep search output schema mode for structured JSON object responses.
|
|
3110
|
+
*/
|
|
3111
|
+
type DeepObjectOutputSchema = {
|
|
3112
|
+
type: "object";
|
|
3113
|
+
/**
|
|
3114
|
+
* JSON-schema-style properties for the result object.
|
|
3115
|
+
*/
|
|
3116
|
+
properties?: Record<string, unknown>;
|
|
3117
|
+
/**
|
|
3118
|
+
* Required property names.
|
|
3119
|
+
*/
|
|
3120
|
+
required?: string[];
|
|
3121
|
+
};
|
|
3122
|
+
/**
|
|
3123
|
+
* Deep search output schema.
|
|
3124
|
+
* - `type: "text"` returns plain text in `output.content` (with optional description guidance).
|
|
3125
|
+
* - `type: "object"` returns structured JSON in `output.content`.
|
|
3126
|
+
*
|
|
3127
|
+
* Note: For object schemas, the API enforces a maximum nesting depth of 2 and a maximum of 10 total properties.
|
|
3128
|
+
*/
|
|
3129
|
+
type DeepOutputSchema = DeepTextOutputSchema | DeepObjectOutputSchema;
|
|
3098
3130
|
/**
|
|
3099
3131
|
* Contents options for deep search.
|
|
3100
3132
|
* @deprecated The `context` field is deprecated. Use `highlights` or `text` instead.
|
|
@@ -3115,10 +3147,13 @@ type DeepSearchOptions = Omit<BaseRegularSearchOptions, "contents"> & {
|
|
|
3115
3147
|
*/
|
|
3116
3148
|
additionalQueries?: string[];
|
|
3117
3149
|
/**
|
|
3118
|
-
*
|
|
3119
|
-
*
|
|
3150
|
+
* Output schema for deep search responses.
|
|
3151
|
+
* - `type: "text"` for plain text output (optionally guided by `description`)
|
|
3152
|
+
* - `type: "object"` for structured JSON output
|
|
3153
|
+
*
|
|
3154
|
+
* Note: For object schemas, the API enforces max depth 2 and max 10 total properties.
|
|
3120
3155
|
*/
|
|
3121
|
-
outputSchema?:
|
|
3156
|
+
outputSchema?: DeepOutputSchema;
|
|
3122
3157
|
/**
|
|
3123
3158
|
* Options for retrieving page contents.
|
|
3124
3159
|
*/
|
|
@@ -3410,20 +3445,26 @@ type SearchResult<T extends ContentsOptions> = {
|
|
|
3410
3445
|
favicon?: string;
|
|
3411
3446
|
entities?: Entity[];
|
|
3412
3447
|
} & ContentsResultComponent<T>;
|
|
3413
|
-
type
|
|
3448
|
+
type DeepSearchOutputGroundingCitation = {
|
|
3414
3449
|
url: string;
|
|
3415
3450
|
title: string;
|
|
3416
3451
|
};
|
|
3452
|
+
type DeepSearchOutputGroundingConfidence = "low" | "medium" | "high";
|
|
3453
|
+
type DeepSearchOutputGrounding = {
|
|
3454
|
+
field: string;
|
|
3455
|
+
citations: DeepSearchOutputGroundingCitation[];
|
|
3456
|
+
confidence: DeepSearchOutputGroundingConfidence;
|
|
3457
|
+
};
|
|
3417
3458
|
type DeepSearchOutput = {
|
|
3418
3459
|
content: string | Record<string, unknown>;
|
|
3419
|
-
|
|
3460
|
+
grounding: DeepSearchOutputGrounding[];
|
|
3420
3461
|
};
|
|
3421
3462
|
/**
|
|
3422
3463
|
* Represents a search response object.
|
|
3423
3464
|
* @typedef {Object} SearchResponse
|
|
3424
3465
|
* @property {Result[]} results - The list of search results.
|
|
3425
3466
|
* @property {string} [context] - Deprecated. The context for the search.
|
|
3426
|
-
* @property {DeepSearchOutput} [output] - Deep search synthesized output object with `content` and `
|
|
3467
|
+
* @property {DeepSearchOutput} [output] - Deep search synthesized output object with `content` and `grounding`.
|
|
3427
3468
|
* @property {string} [autoDate] - The autoprompt date, if applicable.
|
|
3428
3469
|
* @property {string} requestId - The request ID for the search.
|
|
3429
3470
|
* @property {CostDollars} [costDollars] - The cost breakdown for this request.
|
|
@@ -3748,4 +3789,4 @@ declare class Exa {
|
|
|
3748
3789
|
private parseSSEStream;
|
|
3749
3790
|
}
|
|
3750
3791
|
|
|
3751
|
-
export { type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type ArticleEntity, type BaseSearchOptions, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type CsvDataInput, type CustomEntity, type DeepSearchOutput, type
|
|
3792
|
+
export { type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type ArticleEntity, type BaseSearchOptions, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type CsvDataInput, type CustomEntity, type DeepObjectOutputSchema, type DeepOutputSchema, type DeepSearchOutput, type DeepSearchOutputGrounding, type DeepSearchOutputGroundingCitation, type DeepSearchOutputGroundingConfidence, type DeepSearchType, type DeepTextOutputSchema, type Default, type EnrichmentResult, type Entity, type EntityCompanyProperties, type EntityCompanyPropertiesFinancials, type EntityCompanyPropertiesFundingRound, type EntityCompanyPropertiesHeadquarters, type EntityCompanyPropertiesWebTraffic, type EntityCompanyPropertiesWorkforce, type EntityDateRange, type EntityPersonProperties, type EntityPersonPropertiesCompanyRef, type EntityPersonPropertiesWorkHistoryEntry, type Event, EventType, EventsClient, Exa, ExaError, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetWebsetResponse, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type ListResearchRequest, type ListResearchResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, type RegularSearchOptions, type Research, type ResearchCreateParamsTyped, type ResearchCreateRequest, type ResearchCreateResponse, type ResearchDefinitionEvent, type ResearchEvent, type ResearchOperation, type ResearchOutputEvent, type ResearchPaperEntity, type ResearchPlanDefinitionEvent, type ResearchPlanOperationEvent, type ResearchPlanOutputEvent, type ResearchStatus, type ResearchStreamEvent, type ResearchStreamEventTyped, type ResearchTaskDefinitionEvent, type ResearchTaskOperationEvent, type ResearchTaskOutputEvent, type ResearchTyped, type SearchResponse, type SearchResult, type SectionTag, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type UpdateEnrichmentParameters, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateWebhookParameters, type UpdateWebsetRequest, type VerbosityOptions, type WaitUntilCompletedOptions, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, WebsetExcludeSource, type WebsetHeadersLike, WebsetImportSource, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchScopeSource, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, Exa as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -3095,6 +3095,38 @@ type BaseRegularSearchOptions = BaseSearchOptions & {
|
|
|
3095
3095
|
useAutoprompt?: boolean;
|
|
3096
3096
|
};
|
|
3097
3097
|
type DeepSearchType = "deep" | "deep-reasoning" | "deep-max";
|
|
3098
|
+
/**
|
|
3099
|
+
* Deep search output schema mode for plain text responses.
|
|
3100
|
+
*/
|
|
3101
|
+
type DeepTextOutputSchema = {
|
|
3102
|
+
type: "text";
|
|
3103
|
+
/**
|
|
3104
|
+
* Optional formatting guidance for text output.
|
|
3105
|
+
*/
|
|
3106
|
+
description?: string;
|
|
3107
|
+
};
|
|
3108
|
+
/**
|
|
3109
|
+
* Deep search output schema mode for structured JSON object responses.
|
|
3110
|
+
*/
|
|
3111
|
+
type DeepObjectOutputSchema = {
|
|
3112
|
+
type: "object";
|
|
3113
|
+
/**
|
|
3114
|
+
* JSON-schema-style properties for the result object.
|
|
3115
|
+
*/
|
|
3116
|
+
properties?: Record<string, unknown>;
|
|
3117
|
+
/**
|
|
3118
|
+
* Required property names.
|
|
3119
|
+
*/
|
|
3120
|
+
required?: string[];
|
|
3121
|
+
};
|
|
3122
|
+
/**
|
|
3123
|
+
* Deep search output schema.
|
|
3124
|
+
* - `type: "text"` returns plain text in `output.content` (with optional description guidance).
|
|
3125
|
+
* - `type: "object"` returns structured JSON in `output.content`.
|
|
3126
|
+
*
|
|
3127
|
+
* Note: For object schemas, the API enforces a maximum nesting depth of 2 and a maximum of 10 total properties.
|
|
3128
|
+
*/
|
|
3129
|
+
type DeepOutputSchema = DeepTextOutputSchema | DeepObjectOutputSchema;
|
|
3098
3130
|
/**
|
|
3099
3131
|
* Contents options for deep search.
|
|
3100
3132
|
* @deprecated The `context` field is deprecated. Use `highlights` or `text` instead.
|
|
@@ -3115,10 +3147,13 @@ type DeepSearchOptions = Omit<BaseRegularSearchOptions, "contents"> & {
|
|
|
3115
3147
|
*/
|
|
3116
3148
|
additionalQueries?: string[];
|
|
3117
3149
|
/**
|
|
3118
|
-
*
|
|
3119
|
-
*
|
|
3150
|
+
* Output schema for deep search responses.
|
|
3151
|
+
* - `type: "text"` for plain text output (optionally guided by `description`)
|
|
3152
|
+
* - `type: "object"` for structured JSON output
|
|
3153
|
+
*
|
|
3154
|
+
* Note: For object schemas, the API enforces max depth 2 and max 10 total properties.
|
|
3120
3155
|
*/
|
|
3121
|
-
outputSchema?:
|
|
3156
|
+
outputSchema?: DeepOutputSchema;
|
|
3122
3157
|
/**
|
|
3123
3158
|
* Options for retrieving page contents.
|
|
3124
3159
|
*/
|
|
@@ -3410,20 +3445,26 @@ type SearchResult<T extends ContentsOptions> = {
|
|
|
3410
3445
|
favicon?: string;
|
|
3411
3446
|
entities?: Entity[];
|
|
3412
3447
|
} & ContentsResultComponent<T>;
|
|
3413
|
-
type
|
|
3448
|
+
type DeepSearchOutputGroundingCitation = {
|
|
3414
3449
|
url: string;
|
|
3415
3450
|
title: string;
|
|
3416
3451
|
};
|
|
3452
|
+
type DeepSearchOutputGroundingConfidence = "low" | "medium" | "high";
|
|
3453
|
+
type DeepSearchOutputGrounding = {
|
|
3454
|
+
field: string;
|
|
3455
|
+
citations: DeepSearchOutputGroundingCitation[];
|
|
3456
|
+
confidence: DeepSearchOutputGroundingConfidence;
|
|
3457
|
+
};
|
|
3417
3458
|
type DeepSearchOutput = {
|
|
3418
3459
|
content: string | Record<string, unknown>;
|
|
3419
|
-
|
|
3460
|
+
grounding: DeepSearchOutputGrounding[];
|
|
3420
3461
|
};
|
|
3421
3462
|
/**
|
|
3422
3463
|
* Represents a search response object.
|
|
3423
3464
|
* @typedef {Object} SearchResponse
|
|
3424
3465
|
* @property {Result[]} results - The list of search results.
|
|
3425
3466
|
* @property {string} [context] - Deprecated. The context for the search.
|
|
3426
|
-
* @property {DeepSearchOutput} [output] - Deep search synthesized output object with `content` and `
|
|
3467
|
+
* @property {DeepSearchOutput} [output] - Deep search synthesized output object with `content` and `grounding`.
|
|
3427
3468
|
* @property {string} [autoDate] - The autoprompt date, if applicable.
|
|
3428
3469
|
* @property {string} requestId - The request ID for the search.
|
|
3429
3470
|
* @property {CostDollars} [costDollars] - The cost breakdown for this request.
|
|
@@ -3748,4 +3789,4 @@ declare class Exa {
|
|
|
3748
3789
|
private parseSSEStream;
|
|
3749
3790
|
}
|
|
3750
3791
|
|
|
3751
|
-
export { type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type ArticleEntity, type BaseSearchOptions, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type CsvDataInput, type CustomEntity, type DeepSearchOutput, type
|
|
3792
|
+
export { type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type ArticleEntity, type BaseSearchOptions, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type CsvDataInput, type CustomEntity, type DeepObjectOutputSchema, type DeepOutputSchema, type DeepSearchOutput, type DeepSearchOutputGrounding, type DeepSearchOutputGroundingCitation, type DeepSearchOutputGroundingConfidence, type DeepSearchType, type DeepTextOutputSchema, type Default, type EnrichmentResult, type Entity, type EntityCompanyProperties, type EntityCompanyPropertiesFinancials, type EntityCompanyPropertiesFundingRound, type EntityCompanyPropertiesHeadquarters, type EntityCompanyPropertiesWebTraffic, type EntityCompanyPropertiesWorkforce, type EntityDateRange, type EntityPersonProperties, type EntityPersonPropertiesCompanyRef, type EntityPersonPropertiesWorkHistoryEntry, type Event, EventType, EventsClient, Exa, ExaError, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetWebsetResponse, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type ListResearchRequest, type ListResearchResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, type RegularSearchOptions, type Research, type ResearchCreateParamsTyped, type ResearchCreateRequest, type ResearchCreateResponse, type ResearchDefinitionEvent, type ResearchEvent, type ResearchOperation, type ResearchOutputEvent, type ResearchPaperEntity, type ResearchPlanDefinitionEvent, type ResearchPlanOperationEvent, type ResearchPlanOutputEvent, type ResearchStatus, type ResearchStreamEvent, type ResearchStreamEventTyped, type ResearchTaskDefinitionEvent, type ResearchTaskOperationEvent, type ResearchTaskOutputEvent, type ResearchTyped, type SearchResponse, type SearchResult, type SectionTag, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type UpdateEnrichmentParameters, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateWebhookParameters, type UpdateWebsetRequest, type VerbosityOptions, type WaitUntilCompletedOptions, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, WebsetExcludeSource, type WebsetHeadersLike, WebsetImportSource, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchScopeSource, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, Exa as default };
|
package/dist/index.js
CHANGED