exa-js 1.0.1 → 1.0.2
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.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -74,8 +74,8 @@ declare class Exa {
|
|
|
74
74
|
* @param {SearchOptions} [options] - Additional search options.
|
|
75
75
|
* @returns {Promise<SearchResponse>} A list of relevant search results.
|
|
76
76
|
*/
|
|
77
|
-
search(query: string, options
|
|
78
|
-
searchAndContents<T extends ContentsOptions>(query: string, options
|
|
77
|
+
search(query: string, options?: RegularSearchOptions): Promise<SearchResponse>;
|
|
78
|
+
searchAndContents<T extends ContentsOptions>(query: string, options?: RegularSearchOptions & T): Promise<SearchResponse<T>>;
|
|
79
79
|
/**
|
|
80
80
|
* Finds similar links to the provided URL.
|
|
81
81
|
* @param {string} url - The URL for which to find similar links.
|
|
@@ -83,7 +83,7 @@ declare class Exa {
|
|
|
83
83
|
* @returns {Promise<SearchResponse>} A list of similar search results.
|
|
84
84
|
*/
|
|
85
85
|
findSimilar(url: string, options?: FindSimilarOptions): Promise<SearchResponse>;
|
|
86
|
-
findSimilarAndContents<T extends ContentsOptions>(url: string, options
|
|
86
|
+
findSimilarAndContents<T extends ContentsOptions>(url: string, options?: FindSimilarOptions & T): Promise<SearchResponse<T>>;
|
|
87
87
|
/**
|
|
88
88
|
* Retrieves contents of documents based on a list of document IDs.
|
|
89
89
|
* @param {string | string[] | SearchResult[]} ids - An array of document IDs.
|
package/dist/index.js
CHANGED
|
@@ -85,7 +85,7 @@ var Exa = class {
|
|
|
85
85
|
return await this.request("/search", "POST", { query, ...options });
|
|
86
86
|
}
|
|
87
87
|
async searchAndContents(query, options) {
|
|
88
|
-
const { text, highlights, ...rest } = options;
|
|
88
|
+
const { text, highlights, ...rest } = options || {};
|
|
89
89
|
return await this.request("/search", "POST", {
|
|
90
90
|
query,
|
|
91
91
|
contents: {
|
|
@@ -105,7 +105,7 @@ var Exa = class {
|
|
|
105
105
|
return await this.request("/findSimilar", "POST", { url, ...options });
|
|
106
106
|
}
|
|
107
107
|
async findSimilarAndContents(url, options) {
|
|
108
|
-
const { text, highlights, ...rest } = options;
|
|
108
|
+
const { text, highlights, ...rest } = options || {};
|
|
109
109
|
return await this.request("/findSimilar", "POST", {
|
|
110
110
|
url,
|
|
111
111
|
contents: {
|
package/dist/index.mjs
CHANGED
|
@@ -51,7 +51,7 @@ var Exa = class {
|
|
|
51
51
|
return await this.request("/search", "POST", { query, ...options });
|
|
52
52
|
}
|
|
53
53
|
async searchAndContents(query, options) {
|
|
54
|
-
const { text, highlights, ...rest } = options;
|
|
54
|
+
const { text, highlights, ...rest } = options || {};
|
|
55
55
|
return await this.request("/search", "POST", {
|
|
56
56
|
query,
|
|
57
57
|
contents: {
|
|
@@ -71,7 +71,7 @@ var Exa = class {
|
|
|
71
71
|
return await this.request("/findSimilar", "POST", { url, ...options });
|
|
72
72
|
}
|
|
73
73
|
async findSimilarAndContents(url, options) {
|
|
74
|
-
const { text, highlights, ...rest } = options;
|
|
74
|
+
const { text, highlights, ...rest } = options || {};
|
|
75
75
|
return await this.request("/findSimilar", "POST", {
|
|
76
76
|
url,
|
|
77
77
|
contents: {
|