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.mjs
CHANGED
|
@@ -774,7 +774,7 @@ var ResearchBaseClient = class {
|
|
|
774
774
|
// src/research/openapi.ts
|
|
775
775
|
var ResearchCreateTaskRequestDtoModel = /* @__PURE__ */ ((ResearchCreateTaskRequestDtoModel2) => {
|
|
776
776
|
ResearchCreateTaskRequestDtoModel2["exa_research"] = "exa-research";
|
|
777
|
-
ResearchCreateTaskRequestDtoModel2["
|
|
777
|
+
ResearchCreateTaskRequestDtoModel2["exa_research_pro"] = "exa-research-pro";
|
|
778
778
|
return ResearchCreateTaskRequestDtoModel2;
|
|
779
779
|
})(ResearchCreateTaskRequestDtoModel || {});
|
|
780
780
|
var ResearchTaskDtoStatus = /* @__PURE__ */ ((ResearchTaskDtoStatus2) => {
|
|
@@ -800,10 +800,14 @@ var ResearchClient = class extends ResearchBaseClient {
|
|
|
800
800
|
* @returns An object containing the unique ID of the created research task.
|
|
801
801
|
*/
|
|
802
802
|
async createTask(params) {
|
|
803
|
-
const { model,
|
|
803
|
+
const { instructions, model, output } = params;
|
|
804
804
|
const payload = {
|
|
805
|
+
instructions,
|
|
805
806
|
model: model ?? "exa-research" /* exa_research */,
|
|
806
|
-
|
|
807
|
+
output: output ? {
|
|
808
|
+
schema: output.schema,
|
|
809
|
+
inferSchema: output.inferSchema ?? true
|
|
810
|
+
} : { inferSchema: true }
|
|
807
811
|
};
|
|
808
812
|
return this.request(
|
|
809
813
|
"/tasks",
|
|
@@ -969,7 +973,10 @@ var Exa2 = class {
|
|
|
969
973
|
if (!errorData.path) {
|
|
970
974
|
errorData.path = endpoint;
|
|
971
975
|
}
|
|
972
|
-
|
|
976
|
+
let message = errorData.error || "Unknown error";
|
|
977
|
+
if (errorData.message) {
|
|
978
|
+
message += (message.length > 0 ? ". " : "") + errorData.message;
|
|
979
|
+
}
|
|
973
980
|
throw new ExaError(
|
|
974
981
|
message,
|
|
975
982
|
response.status,
|