exa-js 1.8.0 → 1.8.1
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 +16 -4
- package/dist/index.d.ts +16 -4
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1676,14 +1676,22 @@ interface components {
|
|
|
1676
1676
|
nextCursor: string | null;
|
|
1677
1677
|
};
|
|
1678
1678
|
ResearchCreateTaskRequestDto: {
|
|
1679
|
+
input?: {
|
|
1680
|
+
instructions: string;
|
|
1681
|
+
};
|
|
1679
1682
|
/** @description Instructions for what the research task should accomplish */
|
|
1680
|
-
instructions
|
|
1683
|
+
instructions?: string;
|
|
1681
1684
|
/**
|
|
1682
1685
|
* @default exa-research
|
|
1683
1686
|
* @enum {string}
|
|
1684
1687
|
*/
|
|
1685
1688
|
model: ResearchCreateTaskRequestDtoModel;
|
|
1686
1689
|
output?: {
|
|
1690
|
+
/**
|
|
1691
|
+
* @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.
|
|
1692
|
+
* @default true
|
|
1693
|
+
*/
|
|
1694
|
+
inferSchema: boolean;
|
|
1687
1695
|
/** @description A JsonSchema specification of the desired output. See https://json-schema.org/draft-07. */
|
|
1688
1696
|
schema?: unknown;
|
|
1689
1697
|
};
|
|
@@ -1691,6 +1699,9 @@ interface components {
|
|
|
1691
1699
|
ResearchCreateTaskResponseDto: {
|
|
1692
1700
|
/** @description The unique identifier for the research task */
|
|
1693
1701
|
id: string;
|
|
1702
|
+
outputSchema: {
|
|
1703
|
+
[key: string]: unknown;
|
|
1704
|
+
};
|
|
1694
1705
|
};
|
|
1695
1706
|
ResearchTaskDto: {
|
|
1696
1707
|
/** @description Citations grouped by the root field they were used in */
|
|
@@ -1732,7 +1743,7 @@ type SchemaResearchCreateTaskResponseDto = components["schemas"]["ResearchCreate
|
|
|
1732
1743
|
type SchemaResearchTaskDto = components["schemas"]["ResearchTaskDto"];
|
|
1733
1744
|
declare enum ResearchCreateTaskRequestDtoModel {
|
|
1734
1745
|
exa_research = "exa-research",
|
|
1735
|
-
|
|
1746
|
+
exa_research_pro = "exa-research-pro"
|
|
1736
1747
|
}
|
|
1737
1748
|
declare enum ResearchTaskDtoStatus {
|
|
1738
1749
|
running = "running",
|
|
@@ -1800,8 +1811,9 @@ declare class ResearchClient extends ResearchBaseClient {
|
|
|
1800
1811
|
createTask(params: {
|
|
1801
1812
|
instructions: string;
|
|
1802
1813
|
model?: ResearchCreateTaskRequestDtoModel;
|
|
1803
|
-
output
|
|
1804
|
-
|
|
1814
|
+
output?: {
|
|
1815
|
+
inferSchema?: boolean;
|
|
1816
|
+
schema?: JSONSchema;
|
|
1805
1817
|
};
|
|
1806
1818
|
}): Promise<SchemaResearchCreateTaskResponseDto>;
|
|
1807
1819
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1676,14 +1676,22 @@ interface components {
|
|
|
1676
1676
|
nextCursor: string | null;
|
|
1677
1677
|
};
|
|
1678
1678
|
ResearchCreateTaskRequestDto: {
|
|
1679
|
+
input?: {
|
|
1680
|
+
instructions: string;
|
|
1681
|
+
};
|
|
1679
1682
|
/** @description Instructions for what the research task should accomplish */
|
|
1680
|
-
instructions
|
|
1683
|
+
instructions?: string;
|
|
1681
1684
|
/**
|
|
1682
1685
|
* @default exa-research
|
|
1683
1686
|
* @enum {string}
|
|
1684
1687
|
*/
|
|
1685
1688
|
model: ResearchCreateTaskRequestDtoModel;
|
|
1686
1689
|
output?: {
|
|
1690
|
+
/**
|
|
1691
|
+
* @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.
|
|
1692
|
+
* @default true
|
|
1693
|
+
*/
|
|
1694
|
+
inferSchema: boolean;
|
|
1687
1695
|
/** @description A JsonSchema specification of the desired output. See https://json-schema.org/draft-07. */
|
|
1688
1696
|
schema?: unknown;
|
|
1689
1697
|
};
|
|
@@ -1691,6 +1699,9 @@ interface components {
|
|
|
1691
1699
|
ResearchCreateTaskResponseDto: {
|
|
1692
1700
|
/** @description The unique identifier for the research task */
|
|
1693
1701
|
id: string;
|
|
1702
|
+
outputSchema: {
|
|
1703
|
+
[key: string]: unknown;
|
|
1704
|
+
};
|
|
1694
1705
|
};
|
|
1695
1706
|
ResearchTaskDto: {
|
|
1696
1707
|
/** @description Citations grouped by the root field they were used in */
|
|
@@ -1732,7 +1743,7 @@ type SchemaResearchCreateTaskResponseDto = components["schemas"]["ResearchCreate
|
|
|
1732
1743
|
type SchemaResearchTaskDto = components["schemas"]["ResearchTaskDto"];
|
|
1733
1744
|
declare enum ResearchCreateTaskRequestDtoModel {
|
|
1734
1745
|
exa_research = "exa-research",
|
|
1735
|
-
|
|
1746
|
+
exa_research_pro = "exa-research-pro"
|
|
1736
1747
|
}
|
|
1737
1748
|
declare enum ResearchTaskDtoStatus {
|
|
1738
1749
|
running = "running",
|
|
@@ -1800,8 +1811,9 @@ declare class ResearchClient extends ResearchBaseClient {
|
|
|
1800
1811
|
createTask(params: {
|
|
1801
1812
|
instructions: string;
|
|
1802
1813
|
model?: ResearchCreateTaskRequestDtoModel;
|
|
1803
|
-
output
|
|
1804
|
-
|
|
1814
|
+
output?: {
|
|
1815
|
+
inferSchema?: boolean;
|
|
1816
|
+
schema?: JSONSchema;
|
|
1805
1817
|
};
|
|
1806
1818
|
}): Promise<SchemaResearchCreateTaskResponseDto>;
|
|
1807
1819
|
/**
|
package/dist/index.js
CHANGED
|
@@ -832,7 +832,7 @@ var ResearchBaseClient = class {
|
|
|
832
832
|
// src/research/openapi.ts
|
|
833
833
|
var ResearchCreateTaskRequestDtoModel = /* @__PURE__ */ ((ResearchCreateTaskRequestDtoModel2) => {
|
|
834
834
|
ResearchCreateTaskRequestDtoModel2["exa_research"] = "exa-research";
|
|
835
|
-
ResearchCreateTaskRequestDtoModel2["
|
|
835
|
+
ResearchCreateTaskRequestDtoModel2["exa_research_pro"] = "exa-research-pro";
|
|
836
836
|
return ResearchCreateTaskRequestDtoModel2;
|
|
837
837
|
})(ResearchCreateTaskRequestDtoModel || {});
|
|
838
838
|
var ResearchTaskDtoStatus = /* @__PURE__ */ ((ResearchTaskDtoStatus2) => {
|
|
@@ -858,10 +858,14 @@ var ResearchClient = class extends ResearchBaseClient {
|
|
|
858
858
|
* @returns An object containing the unique ID of the created research task.
|
|
859
859
|
*/
|
|
860
860
|
async createTask(params) {
|
|
861
|
-
const { model,
|
|
861
|
+
const { instructions, model, output } = params;
|
|
862
862
|
const payload = {
|
|
863
|
+
instructions,
|
|
863
864
|
model: model ?? "exa-research" /* exa_research */,
|
|
864
|
-
|
|
865
|
+
output: output ? {
|
|
866
|
+
schema: output.schema,
|
|
867
|
+
inferSchema: output.inferSchema ?? true
|
|
868
|
+
} : { inferSchema: true }
|
|
865
869
|
};
|
|
866
870
|
return this.request(
|
|
867
871
|
"/tasks",
|
|
@@ -1027,7 +1031,10 @@ var Exa2 = class {
|
|
|
1027
1031
|
if (!errorData.path) {
|
|
1028
1032
|
errorData.path = endpoint;
|
|
1029
1033
|
}
|
|
1030
|
-
|
|
1034
|
+
let message = errorData.error || "Unknown error";
|
|
1035
|
+
if (errorData.message) {
|
|
1036
|
+
message += (message.length > 0 ? ". " : "") + errorData.message;
|
|
1037
|
+
}
|
|
1031
1038
|
throw new ExaError(
|
|
1032
1039
|
message,
|
|
1033
1040
|
response.status,
|