exa-js 1.8.8 → 1.8.10
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 +350 -96
- package/dist/index.d.ts +350 -96
- package/dist/index.js +104 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +104 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -15,7 +15,7 @@ interface RequestBody$1 {
|
|
|
15
15
|
/**
|
|
16
16
|
* Common pagination parameters
|
|
17
17
|
*/
|
|
18
|
-
interface PaginationParams
|
|
18
|
+
interface PaginationParams {
|
|
19
19
|
/**
|
|
20
20
|
* Cursor for pagination
|
|
21
21
|
*/
|
|
@@ -50,7 +50,7 @@ declare class WebsetsBaseClient {
|
|
|
50
50
|
* @param pagination The pagination parameters
|
|
51
51
|
* @returns QueryParams object with pagination parameters
|
|
52
52
|
*/
|
|
53
|
-
protected buildPaginationParams(pagination?: PaginationParams
|
|
53
|
+
protected buildPaginationParams(pagination?: PaginationParams): QueryParams$1;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
interface components$1 {
|
|
@@ -1362,21 +1362,21 @@ declare class WebsetItemsClient extends WebsetsBaseClient {
|
|
|
1362
1362
|
* @param params - Optional pagination parameters
|
|
1363
1363
|
* @returns A promise that resolves with the list of Items
|
|
1364
1364
|
*/
|
|
1365
|
-
list(websetId: string, params?: PaginationParams
|
|
1365
|
+
list(websetId: string, params?: PaginationParams): Promise<ListWebsetItemResponse>;
|
|
1366
1366
|
/**
|
|
1367
1367
|
* Iterate through all Items in a Webset, handling pagination automatically
|
|
1368
1368
|
* @param websetId The ID of the Webset
|
|
1369
1369
|
* @param options Pagination options
|
|
1370
1370
|
* @returns Async generator of Webset Items
|
|
1371
1371
|
*/
|
|
1372
|
-
listAll(websetId: string, options?: PaginationParams
|
|
1372
|
+
listAll(websetId: string, options?: PaginationParams): AsyncGenerator<WebsetItem>;
|
|
1373
1373
|
/**
|
|
1374
1374
|
* Collect all items from a Webset into an array
|
|
1375
1375
|
* @param websetId The ID of the Webset
|
|
1376
1376
|
* @param options Pagination options
|
|
1377
1377
|
* @returns Promise resolving to an array of all Webset Items
|
|
1378
1378
|
*/
|
|
1379
|
-
getAll(websetId: string, options?: PaginationParams
|
|
1379
|
+
getAll(websetId: string, options?: PaginationParams): Promise<WebsetItem[]>;
|
|
1380
1380
|
/**
|
|
1381
1381
|
* Get an Item by ID
|
|
1382
1382
|
* @param websetId The ID of the Webset
|
|
@@ -1400,7 +1400,7 @@ declare class WebsetItemsClient extends WebsetsBaseClient {
|
|
|
1400
1400
|
/**
|
|
1401
1401
|
* Options for listing monitors
|
|
1402
1402
|
*/
|
|
1403
|
-
interface ListMonitorsOptions extends PaginationParams
|
|
1403
|
+
interface ListMonitorsOptions extends PaginationParams {
|
|
1404
1404
|
/**
|
|
1405
1405
|
* The id of the Webset to list monitors for
|
|
1406
1406
|
*/
|
|
@@ -1416,7 +1416,7 @@ declare class WebsetMonitorRunsClient extends WebsetsBaseClient {
|
|
|
1416
1416
|
* @param options Pagination options
|
|
1417
1417
|
* @returns The list of Monitor runs
|
|
1418
1418
|
*/
|
|
1419
|
-
list(monitorId: string, options?: PaginationParams
|
|
1419
|
+
list(monitorId: string, options?: PaginationParams): Promise<ListMonitorRunsResponse>;
|
|
1420
1420
|
/**
|
|
1421
1421
|
* Get a specific Monitor run
|
|
1422
1422
|
* @param monitorId The ID of the Monitor
|
|
@@ -1505,12 +1505,12 @@ declare class WebsetSearchesClient extends WebsetsBaseClient {
|
|
|
1505
1505
|
/**
|
|
1506
1506
|
* Options for listing webhooks (only pagination is supported by API)
|
|
1507
1507
|
*/
|
|
1508
|
-
interface ListWebhooksOptions extends PaginationParams
|
|
1508
|
+
interface ListWebhooksOptions extends PaginationParams {
|
|
1509
1509
|
}
|
|
1510
1510
|
/**
|
|
1511
1511
|
* Options for listing webhook attempts
|
|
1512
1512
|
*/
|
|
1513
|
-
interface ListWebhookAttemptsOptions extends PaginationParams
|
|
1513
|
+
interface ListWebhookAttemptsOptions extends PaginationParams {
|
|
1514
1514
|
/**
|
|
1515
1515
|
* The type of event to filter by
|
|
1516
1516
|
*/
|
|
@@ -1593,7 +1593,7 @@ declare class WebsetWebhooksClient extends WebsetsBaseClient {
|
|
|
1593
1593
|
/**
|
|
1594
1594
|
* Options for listing Websets (API only supports pagination)
|
|
1595
1595
|
*/
|
|
1596
|
-
interface ListWebsetsOptions extends PaginationParams
|
|
1596
|
+
interface ListWebsetsOptions extends PaginationParams {
|
|
1597
1597
|
}
|
|
1598
1598
|
/**
|
|
1599
1599
|
* Client for managing Websets
|
|
@@ -1692,6 +1692,102 @@ declare class WebsetsClient extends WebsetsBaseClient {
|
|
|
1692
1692
|
} | number): Promise<Webset>;
|
|
1693
1693
|
}
|
|
1694
1694
|
|
|
1695
|
+
type QueryParams = Record<string, string | number | boolean | string[] | undefined>;
|
|
1696
|
+
interface RequestBody {
|
|
1697
|
+
[key: string]: unknown;
|
|
1698
|
+
}
|
|
1699
|
+
/**
|
|
1700
|
+
* Base client class for all Research-related API clients
|
|
1701
|
+
*/
|
|
1702
|
+
declare class ResearchBaseClient {
|
|
1703
|
+
protected client: Exa;
|
|
1704
|
+
/**
|
|
1705
|
+
* Initialize a new Research base client
|
|
1706
|
+
* @param client The Exa client instance
|
|
1707
|
+
*/
|
|
1708
|
+
constructor(client: Exa);
|
|
1709
|
+
/**
|
|
1710
|
+
* Make a request to the Research API (prefixes all paths with `/research`).
|
|
1711
|
+
* @param endpoint The endpoint path, beginning with a slash (e.g. "/tasks").
|
|
1712
|
+
* @param method The HTTP method. Defaults to "POST".
|
|
1713
|
+
* @param data Optional request body
|
|
1714
|
+
* @param params Optional query parameters
|
|
1715
|
+
* @returns The parsed JSON response
|
|
1716
|
+
*/
|
|
1717
|
+
protected request<T = unknown>(endpoint: string, method?: string, data?: RequestBody, params?: QueryParams): Promise<T>;
|
|
1718
|
+
/**
|
|
1719
|
+
* Make a request to the Research API (prefixes all paths with `/research`).
|
|
1720
|
+
* @param endpoint The endpoint path, beginning with a slash (e.g. "/tasks").
|
|
1721
|
+
* @param method The HTTP method. Defaults to "POST".
|
|
1722
|
+
* @param data Optional request body
|
|
1723
|
+
* @param params Optional query parameters
|
|
1724
|
+
* @returns The parsed JSON response
|
|
1725
|
+
*/
|
|
1726
|
+
protected rawRequest(endpoint: string, method?: string, data?: RequestBody, params?: QueryParams): Promise<Response>;
|
|
1727
|
+
/**
|
|
1728
|
+
* Helper to build pagination parameters.
|
|
1729
|
+
* @param pagination The pagination parameters
|
|
1730
|
+
* @returns QueryParams object with pagination parameters
|
|
1731
|
+
*/
|
|
1732
|
+
protected buildPaginationParams(pagination?: SchemaListResearchTasksRequestDto): QueryParams;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
/**
|
|
1736
|
+
* Client for interacting with the Research Tasks API.
|
|
1737
|
+
*/
|
|
1738
|
+
declare class ResearchClient extends ResearchBaseClient {
|
|
1739
|
+
constructor(client: Exa);
|
|
1740
|
+
/**
|
|
1741
|
+
* Create a new research task.
|
|
1742
|
+
*
|
|
1743
|
+
* @param params Object containing:
|
|
1744
|
+
* - model: The research model to use (e.g., ResearchModel.ExaResearch).
|
|
1745
|
+
* - instructions: High-level guidance for the research agent.
|
|
1746
|
+
* - output: An object with a `schema` property (JSONSchema) that defines the expected output structure.
|
|
1747
|
+
*
|
|
1748
|
+
* @returns An object containing the unique ID of the created research task.
|
|
1749
|
+
*/
|
|
1750
|
+
createTask(params: {
|
|
1751
|
+
instructions: string;
|
|
1752
|
+
model?: ResearchCreateOpenAIResponseDtoModel;
|
|
1753
|
+
output?: {
|
|
1754
|
+
inferSchema?: boolean;
|
|
1755
|
+
schema?: JSONSchema;
|
|
1756
|
+
};
|
|
1757
|
+
}): Promise<SchemaResearchCreateTaskResponseDto>;
|
|
1758
|
+
/**
|
|
1759
|
+
* Retrieve a research task by ID.
|
|
1760
|
+
*
|
|
1761
|
+
* Overloads:
|
|
1762
|
+
* - getTask(id)
|
|
1763
|
+
* - getTask(id, {stream: false})
|
|
1764
|
+
* => Promise<ResearchTask>
|
|
1765
|
+
* - getTask(id, {stream: true})
|
|
1766
|
+
* => AsyncGenerator<ResearchTaskEvent>
|
|
1767
|
+
*/
|
|
1768
|
+
getTask(id: string): Promise<SchemaResearchTaskDto>;
|
|
1769
|
+
getTask(id: string, options: {
|
|
1770
|
+
stream?: false;
|
|
1771
|
+
}): Promise<SchemaResearchTaskDto>;
|
|
1772
|
+
getTask(id: string, options: {
|
|
1773
|
+
stream: true;
|
|
1774
|
+
}): Promise<AsyncGenerator<ResearchTaskEventDtoType, any, any>>;
|
|
1775
|
+
/**
|
|
1776
|
+
* @deprecated This method is deprecated and may be removed in a future release.
|
|
1777
|
+
* @see getTask(id, {stream: true})
|
|
1778
|
+
* Poll a research task until completion or failure.
|
|
1779
|
+
* Polls every 1 second with a maximum timeout of 10 minutes.
|
|
1780
|
+
* Resilient to up to 10 consecutive polling failures.
|
|
1781
|
+
*/
|
|
1782
|
+
pollTask(id: string): Promise<SchemaResearchTaskDto>;
|
|
1783
|
+
/**
|
|
1784
|
+
* List research tasks
|
|
1785
|
+
* @param options Pagination options
|
|
1786
|
+
* @returns The paginated list of research tasks
|
|
1787
|
+
*/
|
|
1788
|
+
listTasks(options?: SchemaListResearchTasksRequestDto): Promise<SchemaListResearchTasksResponseDto>;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1695
1791
|
interface components {
|
|
1696
1792
|
schemas: {
|
|
1697
1793
|
ListResearchTasksRequestDto: {
|
|
@@ -1699,7 +1795,7 @@ interface components {
|
|
|
1699
1795
|
cursor?: string;
|
|
1700
1796
|
/**
|
|
1701
1797
|
* @description The number of results to return
|
|
1702
|
-
* @default
|
|
1798
|
+
* @default 10
|
|
1703
1799
|
*/
|
|
1704
1800
|
limit: number;
|
|
1705
1801
|
};
|
|
@@ -1711,6 +1807,28 @@ interface components {
|
|
|
1711
1807
|
/** @description The cursor to paginate through the next set of results */
|
|
1712
1808
|
nextCursor: string | null;
|
|
1713
1809
|
};
|
|
1810
|
+
ResearchCreateOpenAIResponseDto: {
|
|
1811
|
+
input: string;
|
|
1812
|
+
instructions?: string;
|
|
1813
|
+
/** @enum {string} */
|
|
1814
|
+
model: ResearchCreateOpenAIResponseDtoModel;
|
|
1815
|
+
stream?: boolean;
|
|
1816
|
+
text?: {
|
|
1817
|
+
format?: {
|
|
1818
|
+
/** @enum {string} */
|
|
1819
|
+
type: ResearchCreateOpenAIResponseDtoTextFormatType;
|
|
1820
|
+
} | {
|
|
1821
|
+
description?: string;
|
|
1822
|
+
name?: string;
|
|
1823
|
+
schema: {
|
|
1824
|
+
[key: string]: unknown;
|
|
1825
|
+
};
|
|
1826
|
+
strict?: boolean;
|
|
1827
|
+
/** @enum {string} */
|
|
1828
|
+
type: ResearchCreateOpenAIResponseDtoTextFormatType;
|
|
1829
|
+
};
|
|
1830
|
+
};
|
|
1831
|
+
};
|
|
1714
1832
|
ResearchCreateTaskRequestDto: {
|
|
1715
1833
|
input?: {
|
|
1716
1834
|
instructions: string;
|
|
@@ -1721,7 +1839,7 @@ interface components {
|
|
|
1721
1839
|
* @default exa-research
|
|
1722
1840
|
* @enum {string}
|
|
1723
1841
|
*/
|
|
1724
|
-
model:
|
|
1842
|
+
model: ResearchCreateOpenAIResponseDtoModel;
|
|
1725
1843
|
output?: {
|
|
1726
1844
|
/**
|
|
1727
1845
|
* @description When true and an output schema is omitted, an output schema will be intelligently generated. Otherwise, if this is false and there is no output schema, a generic markdown report will be generated.
|
|
@@ -1749,6 +1867,16 @@ interface components {
|
|
|
1749
1867
|
url: string;
|
|
1750
1868
|
}[];
|
|
1751
1869
|
};
|
|
1870
|
+
costDollars?: {
|
|
1871
|
+
research: {
|
|
1872
|
+
pages: number;
|
|
1873
|
+
reasoningTokens: number;
|
|
1874
|
+
searches: number;
|
|
1875
|
+
};
|
|
1876
|
+
total: number;
|
|
1877
|
+
};
|
|
1878
|
+
/** @description The creation time of the research task in milliseconds since the Unix epoch */
|
|
1879
|
+
createdAt: number;
|
|
1752
1880
|
/** @description The research results data conforming to the specified schema */
|
|
1753
1881
|
data?: {
|
|
1754
1882
|
[key: string]: unknown;
|
|
@@ -1757,6 +1885,52 @@ interface components {
|
|
|
1757
1885
|
id: string;
|
|
1758
1886
|
/** @description The instructions or query for the research task */
|
|
1759
1887
|
instructions: string;
|
|
1888
|
+
/** @enum {string} */
|
|
1889
|
+
model?: ResearchCreateOpenAIResponseDtoModel;
|
|
1890
|
+
operations: ({
|
|
1891
|
+
stepId: string;
|
|
1892
|
+
/** @description Agent generated plan or reasoning for upcoming actions. */
|
|
1893
|
+
text: string;
|
|
1894
|
+
/** @enum {string} */
|
|
1895
|
+
type: ResearchTaskDtoOperationsType;
|
|
1896
|
+
} | {
|
|
1897
|
+
/** @description A completed subfield */
|
|
1898
|
+
data: {
|
|
1899
|
+
[key: string]: unknown;
|
|
1900
|
+
};
|
|
1901
|
+
stepId: string;
|
|
1902
|
+
/** @enum {string} */
|
|
1903
|
+
type: ResearchTaskDtoOperationsType;
|
|
1904
|
+
} | {
|
|
1905
|
+
/** @description What the agent hopes to find with this search query */
|
|
1906
|
+
goal?: string;
|
|
1907
|
+
/** @description Search query used */
|
|
1908
|
+
query: string;
|
|
1909
|
+
results?: {
|
|
1910
|
+
id: string;
|
|
1911
|
+
snippet: string;
|
|
1912
|
+
title?: string;
|
|
1913
|
+
url: string;
|
|
1914
|
+
/** @enum {number} */
|
|
1915
|
+
version: ResearchTaskDtoOperationsResultsVersion;
|
|
1916
|
+
}[];
|
|
1917
|
+
stepId: string;
|
|
1918
|
+
/** @enum {string} */
|
|
1919
|
+
type: ResearchTaskDtoOperationsType;
|
|
1920
|
+
} | {
|
|
1921
|
+
/** @description What the agent hopes to find with this crawl */
|
|
1922
|
+
goal?: string;
|
|
1923
|
+
stepId: string;
|
|
1924
|
+
/** @enum {string} */
|
|
1925
|
+
type: ResearchTaskDtoOperationsType;
|
|
1926
|
+
url: string;
|
|
1927
|
+
} | {
|
|
1928
|
+
stepId: string;
|
|
1929
|
+
/** @description Intermediate chain-of-thought style reasoning output */
|
|
1930
|
+
thought: string;
|
|
1931
|
+
/** @enum {string} */
|
|
1932
|
+
type: ResearchTaskDtoOperationsType;
|
|
1933
|
+
})[];
|
|
1760
1934
|
/** @description The JSON schema specification for the expected output format */
|
|
1761
1935
|
schema?: {
|
|
1762
1936
|
[key: string]: unknown;
|
|
@@ -1766,6 +1940,139 @@ interface components {
|
|
|
1766
1940
|
* @enum {string}
|
|
1767
1941
|
*/
|
|
1768
1942
|
status: ResearchTaskDtoStatus;
|
|
1943
|
+
timeMs?: number;
|
|
1944
|
+
};
|
|
1945
|
+
ResearchTaskEventDto: {
|
|
1946
|
+
stepId: string;
|
|
1947
|
+
/** @description Agent generated plan or reasoning for upcoming actions. */
|
|
1948
|
+
text: string;
|
|
1949
|
+
/** @enum {string} */
|
|
1950
|
+
type: ResearchTaskDtoOperationsType;
|
|
1951
|
+
} | {
|
|
1952
|
+
/** @description A completed subfield */
|
|
1953
|
+
data: {
|
|
1954
|
+
[key: string]: unknown;
|
|
1955
|
+
};
|
|
1956
|
+
stepId: string;
|
|
1957
|
+
/** @enum {string} */
|
|
1958
|
+
type: ResearchTaskDtoOperationsType;
|
|
1959
|
+
} | {
|
|
1960
|
+
/** @description What the agent hopes to find with this search query */
|
|
1961
|
+
goal?: string;
|
|
1962
|
+
/** @description Search query used */
|
|
1963
|
+
query: string;
|
|
1964
|
+
results?: {
|
|
1965
|
+
id: string;
|
|
1966
|
+
snippet: string;
|
|
1967
|
+
title?: string;
|
|
1968
|
+
url: string;
|
|
1969
|
+
/** @enum {number} */
|
|
1970
|
+
version: ResearchTaskDtoOperationsResultsVersion;
|
|
1971
|
+
}[];
|
|
1972
|
+
stepId: string;
|
|
1973
|
+
/** @enum {string} */
|
|
1974
|
+
type: ResearchTaskDtoOperationsType;
|
|
1975
|
+
} | {
|
|
1976
|
+
/** @description What the agent hopes to find with this crawl */
|
|
1977
|
+
goal?: string;
|
|
1978
|
+
stepId: string;
|
|
1979
|
+
/** @enum {string} */
|
|
1980
|
+
type: ResearchTaskDtoOperationsType;
|
|
1981
|
+
url: string;
|
|
1982
|
+
} | {
|
|
1983
|
+
stepId: string;
|
|
1984
|
+
/** @description Intermediate chain-of-thought style reasoning output */
|
|
1985
|
+
thought: string;
|
|
1986
|
+
/** @enum {string} */
|
|
1987
|
+
type: ResearchTaskDtoOperationsType;
|
|
1988
|
+
} | {
|
|
1989
|
+
task: {
|
|
1990
|
+
/** @description Citations grouped by the root field they were used in */
|
|
1991
|
+
citations?: {
|
|
1992
|
+
[key: string]: {
|
|
1993
|
+
id: string;
|
|
1994
|
+
snippet: string;
|
|
1995
|
+
title?: string;
|
|
1996
|
+
url: string;
|
|
1997
|
+
}[];
|
|
1998
|
+
};
|
|
1999
|
+
costDollars?: {
|
|
2000
|
+
research: {
|
|
2001
|
+
pages: number;
|
|
2002
|
+
reasoningTokens: number;
|
|
2003
|
+
searches: number;
|
|
2004
|
+
};
|
|
2005
|
+
total: number;
|
|
2006
|
+
};
|
|
2007
|
+
/** @description The creation time of the research task in milliseconds since the Unix epoch */
|
|
2008
|
+
createdAt: number;
|
|
2009
|
+
/** @description The research results data conforming to the specified schema */
|
|
2010
|
+
data?: {
|
|
2011
|
+
[key: string]: unknown;
|
|
2012
|
+
};
|
|
2013
|
+
/** @description The unique identifier for the research task */
|
|
2014
|
+
id: string;
|
|
2015
|
+
/** @description The instructions or query for the research task */
|
|
2016
|
+
instructions: string;
|
|
2017
|
+
/** @enum {string} */
|
|
2018
|
+
model?: ResearchCreateOpenAIResponseDtoModel;
|
|
2019
|
+
operations: ({
|
|
2020
|
+
stepId: string;
|
|
2021
|
+
/** @description Agent generated plan or reasoning for upcoming actions. */
|
|
2022
|
+
text: string;
|
|
2023
|
+
/** @enum {string} */
|
|
2024
|
+
type: ResearchTaskDtoOperationsType;
|
|
2025
|
+
} | {
|
|
2026
|
+
/** @description A completed subfield */
|
|
2027
|
+
data: {
|
|
2028
|
+
[key: string]: unknown;
|
|
2029
|
+
};
|
|
2030
|
+
stepId: string;
|
|
2031
|
+
/** @enum {string} */
|
|
2032
|
+
type: ResearchTaskDtoOperationsType;
|
|
2033
|
+
} | {
|
|
2034
|
+
/** @description What the agent hopes to find with this search query */
|
|
2035
|
+
goal?: string;
|
|
2036
|
+
/** @description Search query used */
|
|
2037
|
+
query: string;
|
|
2038
|
+
results?: {
|
|
2039
|
+
id: string;
|
|
2040
|
+
snippet: string;
|
|
2041
|
+
title?: string;
|
|
2042
|
+
url: string;
|
|
2043
|
+
/** @enum {number} */
|
|
2044
|
+
version: ResearchTaskDtoOperationsResultsVersion;
|
|
2045
|
+
}[];
|
|
2046
|
+
stepId: string;
|
|
2047
|
+
/** @enum {string} */
|
|
2048
|
+
type: ResearchTaskDtoOperationsType;
|
|
2049
|
+
} | {
|
|
2050
|
+
/** @description What the agent hopes to find with this crawl */
|
|
2051
|
+
goal?: string;
|
|
2052
|
+
stepId: string;
|
|
2053
|
+
/** @enum {string} */
|
|
2054
|
+
type: ResearchTaskDtoOperationsType;
|
|
2055
|
+
url: string;
|
|
2056
|
+
} | {
|
|
2057
|
+
stepId: string;
|
|
2058
|
+
/** @description Intermediate chain-of-thought style reasoning output */
|
|
2059
|
+
thought: string;
|
|
2060
|
+
/** @enum {string} */
|
|
2061
|
+
type: ResearchTaskDtoOperationsType;
|
|
2062
|
+
})[];
|
|
2063
|
+
/** @description The JSON schema specification for the expected output format */
|
|
2064
|
+
schema?: {
|
|
2065
|
+
[key: string]: unknown;
|
|
2066
|
+
};
|
|
2067
|
+
/**
|
|
2068
|
+
* @description The current status of the research task
|
|
2069
|
+
* @enum {string}
|
|
2070
|
+
*/
|
|
2071
|
+
status: ResearchTaskDtoStatus;
|
|
2072
|
+
timeMs?: number;
|
|
2073
|
+
};
|
|
2074
|
+
/** @enum {string} */
|
|
2075
|
+
type: ResearchTaskEventDtoType;
|
|
1769
2076
|
};
|
|
1770
2077
|
};
|
|
1771
2078
|
responses: never;
|
|
@@ -1774,100 +2081,46 @@ interface components {
|
|
|
1774
2081
|
headers: never;
|
|
1775
2082
|
pathItems: never;
|
|
1776
2083
|
}
|
|
2084
|
+
type SchemaListResearchTasksRequestDto = components["schemas"]["ListResearchTasksRequestDto"];
|
|
1777
2085
|
type SchemaListResearchTasksResponseDto = components["schemas"]["ListResearchTasksResponseDto"];
|
|
2086
|
+
type SchemaResearchCreateTaskRequestDto = components["schemas"]["ResearchCreateTaskRequestDto"];
|
|
1778
2087
|
type SchemaResearchCreateTaskResponseDto = components["schemas"]["ResearchCreateTaskResponseDto"];
|
|
1779
2088
|
type SchemaResearchTaskDto = components["schemas"]["ResearchTaskDto"];
|
|
1780
|
-
declare enum
|
|
2089
|
+
declare enum ResearchCreateOpenAIResponseDtoModel {
|
|
1781
2090
|
exa_research = "exa-research",
|
|
1782
2091
|
exa_research_pro = "exa-research-pro"
|
|
1783
2092
|
}
|
|
2093
|
+
declare enum ResearchCreateOpenAIResponseDtoTextFormatType {
|
|
2094
|
+
text = "text"
|
|
2095
|
+
}
|
|
2096
|
+
declare enum ResearchCreateOpenAIResponseDtoTextFormatType {
|
|
2097
|
+
json_schema = "json_schema"
|
|
2098
|
+
}
|
|
2099
|
+
declare enum ResearchTaskDtoOperationsResultsVersion {
|
|
2100
|
+
Value1 = 1
|
|
2101
|
+
}
|
|
2102
|
+
declare enum ResearchTaskDtoOperationsType {
|
|
2103
|
+
step_plan = "step-plan"
|
|
2104
|
+
}
|
|
2105
|
+
declare enum ResearchTaskDtoOperationsType {
|
|
2106
|
+
step_data = "step-data"
|
|
2107
|
+
}
|
|
2108
|
+
declare enum ResearchTaskDtoOperationsType {
|
|
2109
|
+
search = "search"
|
|
2110
|
+
}
|
|
2111
|
+
declare enum ResearchTaskDtoOperationsType {
|
|
2112
|
+
crawl = "crawl"
|
|
2113
|
+
}
|
|
2114
|
+
declare enum ResearchTaskDtoOperationsType {
|
|
2115
|
+
think = "think"
|
|
2116
|
+
}
|
|
1784
2117
|
declare enum ResearchTaskDtoStatus {
|
|
1785
2118
|
running = "running",
|
|
1786
2119
|
completed = "completed",
|
|
1787
2120
|
failed = "failed"
|
|
1788
2121
|
}
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
/** Cursor for pagination */
|
|
1792
|
-
cursor?: string;
|
|
1793
|
-
/** Maximum number of items per page */
|
|
1794
|
-
limit?: number;
|
|
1795
|
-
}
|
|
1796
|
-
/**
|
|
1797
|
-
* Options for listing research tasks (API only supports pagination)
|
|
1798
|
-
*/
|
|
1799
|
-
type ListResearchTasksOptions = PaginationParams;
|
|
1800
|
-
|
|
1801
|
-
type QueryParams = Record<string, string | number | boolean | string[] | undefined>;
|
|
1802
|
-
interface RequestBody {
|
|
1803
|
-
[key: string]: unknown;
|
|
1804
|
-
}
|
|
1805
|
-
/**
|
|
1806
|
-
* Base client class for all Research-related API clients
|
|
1807
|
-
*/
|
|
1808
|
-
declare class ResearchBaseClient {
|
|
1809
|
-
protected client: Exa;
|
|
1810
|
-
/**
|
|
1811
|
-
* Initialize a new Research base client
|
|
1812
|
-
* @param client The Exa client instance
|
|
1813
|
-
*/
|
|
1814
|
-
constructor(client: Exa);
|
|
1815
|
-
/**
|
|
1816
|
-
* Make a request to the Research API (prefixes all paths with `/research`).
|
|
1817
|
-
* @param endpoint The endpoint path, beginning with a slash (e.g. "/tasks").
|
|
1818
|
-
* @param method The HTTP method. Defaults to "POST".
|
|
1819
|
-
* @param data Optional request body
|
|
1820
|
-
* @param params Optional query parameters
|
|
1821
|
-
* @returns The parsed JSON response
|
|
1822
|
-
*/
|
|
1823
|
-
protected request<T = unknown>(endpoint: string, method?: string, data?: RequestBody, params?: QueryParams): Promise<T>;
|
|
1824
|
-
/**
|
|
1825
|
-
* Helper to build pagination parameters.
|
|
1826
|
-
* @param pagination The pagination parameters
|
|
1827
|
-
* @returns QueryParams object with pagination parameters
|
|
1828
|
-
*/
|
|
1829
|
-
protected buildPaginationParams(pagination?: PaginationParams): QueryParams;
|
|
1830
|
-
}
|
|
1831
|
-
|
|
1832
|
-
/**
|
|
1833
|
-
* Client for interacting with the Research Tasks API.
|
|
1834
|
-
*/
|
|
1835
|
-
declare class ResearchClient extends ResearchBaseClient {
|
|
1836
|
-
constructor(client: Exa);
|
|
1837
|
-
/**
|
|
1838
|
-
* Create a new research task.
|
|
1839
|
-
*
|
|
1840
|
-
* @param params Object containing:
|
|
1841
|
-
* - model: The research model to use (e.g., ResearchModel.ExaResearch).
|
|
1842
|
-
* - instructions: High-level guidance for the research agent.
|
|
1843
|
-
* - output: An object with a `schema` property (JSONSchema) that defines the expected output structure.
|
|
1844
|
-
*
|
|
1845
|
-
* @returns An object containing the unique ID of the created research task.
|
|
1846
|
-
*/
|
|
1847
|
-
createTask(params: {
|
|
1848
|
-
instructions: string;
|
|
1849
|
-
model?: ResearchCreateTaskRequestDtoModel;
|
|
1850
|
-
output?: {
|
|
1851
|
-
inferSchema?: boolean;
|
|
1852
|
-
schema?: JSONSchema;
|
|
1853
|
-
};
|
|
1854
|
-
}): Promise<SchemaResearchCreateTaskResponseDto>;
|
|
1855
|
-
/**
|
|
1856
|
-
* Retrieve a research task by ID.
|
|
1857
|
-
*/
|
|
1858
|
-
getTask(id: string): Promise<SchemaResearchTaskDto>;
|
|
1859
|
-
/**
|
|
1860
|
-
* Poll a research task until completion or failure.
|
|
1861
|
-
* Polls every 1 second with a maximum timeout of 10 minutes.
|
|
1862
|
-
* Resilient to up to 10 consecutive polling failures.
|
|
1863
|
-
*/
|
|
1864
|
-
pollTask(id: string): Promise<SchemaResearchTaskDto>;
|
|
1865
|
-
/**
|
|
1866
|
-
* List research tasks
|
|
1867
|
-
* @param options Pagination options
|
|
1868
|
-
* @returns The paginated list of research tasks
|
|
1869
|
-
*/
|
|
1870
|
-
listTasks(options?: ListResearchTasksOptions): Promise<SchemaListResearchTasksResponseDto>;
|
|
2122
|
+
declare enum ResearchTaskEventDtoType {
|
|
2123
|
+
completed = "completed"
|
|
1871
2124
|
}
|
|
1872
2125
|
|
|
1873
2126
|
/**
|
|
@@ -2276,6 +2529,7 @@ declare class Exa {
|
|
|
2276
2529
|
* @throws {ExaError} When any API request fails with structured error information
|
|
2277
2530
|
*/
|
|
2278
2531
|
request<T = unknown>(endpoint: string, method: string, body?: any, params?: Record<string, any>): Promise<T>;
|
|
2532
|
+
rawRequest(endpoint: string, method?: string, body?: Record<string, unknown>, queryParams?: Record<string, string | number | boolean | string[] | undefined>): Promise<Response>;
|
|
2279
2533
|
/**
|
|
2280
2534
|
* Performs a search with an Exa prompt-engineered query.
|
|
2281
2535
|
*
|
|
@@ -2365,4 +2619,4 @@ declare class Exa {
|
|
|
2365
2619
|
private parseSSEStream;
|
|
2366
2620
|
}
|
|
2367
2621
|
|
|
2368
|
-
export { type AnswerOptions, type AnswerResponse, type AnswerStreamChunk, type AnswerStreamResponse, type BaseSearchOptions, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateMonitorParameters, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type Default, type EnrichmentResult, type Event, EventType, EventsClient, Exa, ExaError, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetWebsetResponse, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type JSONSchema, type ListEventsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type
|
|
2622
|
+
export { type AnswerOptions, type AnswerResponse, type AnswerStreamChunk, type AnswerStreamResponse, type BaseSearchOptions, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateMonitorParameters, type CreateWebhookParameters, type CreateWebsetParameters, type CreateWebsetSearchParameters, type Default, type EnrichmentResult, type Event, EventType, EventsClient, Exa, ExaError, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetWebsetResponse, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type JSONSchema, type ListEventsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type SchemaListResearchTasksRequestDto as ListResearchTasksRequest, type SchemaListResearchTasksResponseDto as ListResearchTasksResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehaviorRefresh, type MonitorBehaviorSearch, type MonitorCadence, MonitorObject, type MonitorRefreshBehaviorContentsConfig, type MonitorRefreshBehaviorEnrichmentsConfig, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, type RegularSearchOptions, ResearchClient, type SchemaResearchCreateTaskRequestDto as ResearchCreateTaskRequest, type SchemaResearchCreateTaskResponseDto as ResearchCreateTaskResponse, ResearchTaskEventDtoType as ResearchEvent, ResearchCreateOpenAIResponseDtoModel as ResearchModel, ResearchTaskDtoStatus as ResearchStatus, type SchemaResearchTaskDto as ResearchTask, type SearchResponse, type SearchResult, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryResponse, type TextContentsOptions, type TextResponse, type UpdateMonitor, UpdateMonitorStatus, type UpdateWebhookParameters, type UpdateWebsetRequest, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetArticleEntity, type WebsetCompanyEntity, type WebsetCustomEntity, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, type WebsetEntity, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetPersonEntity, type WebsetResearchPaperEntity, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, Exa as default };
|