aimyapi 1.0.3 → 1.0.4
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.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/index.mjs +5 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -405,7 +405,7 @@ async function createSandbox(QuickJS, requireLookup = {}, globals = {}, debug =
|
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
require$1("dotenv").config();
|
|
408
|
-
const openai = new openai$1.OpenAI();
|
|
408
|
+
const openai = new openai$1.OpenAI({ baseURL: process.env.OPENAI_API_BASE_URL || void 0, apiKey: process.env.OPENAI_API_KEY || void 0 });
|
|
409
409
|
let QuickJS = null;
|
|
410
410
|
const wrapCode = (apiGlobalName, apiFileDefPath, code) => `
|
|
411
411
|
(async () => {
|
|
@@ -590,9 +590,9 @@ async function createWithAPI(options) {
|
|
|
590
590
|
};
|
|
591
591
|
}
|
|
592
592
|
}
|
|
593
|
-
const { vm, checkCode } = await createSandbox(QuickJS, {
|
|
593
|
+
const { vm, checkCode } = await createSandbox(QuickJS, apiExports ? {
|
|
594
594
|
[apiDefFilePath]: apiExports
|
|
595
|
-
}, {
|
|
595
|
+
} : void 0, {
|
|
596
596
|
...apiGlobals,
|
|
597
597
|
[apiGlobalName]: {
|
|
598
598
|
value: apiObject,
|
|
@@ -649,9 +649,9 @@ async function createWithAPI(options) {
|
|
|
649
649
|
};
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
const { vm, runCode: runTask, isAsyncProcessRunning } = await createSandbox(QuickJS, {
|
|
652
|
+
const { vm, runCode: runTask, isAsyncProcessRunning } = await createSandbox(QuickJS, apiExports ? {
|
|
653
653
|
[apiDefFilePath]: apiExports
|
|
654
|
-
}, {
|
|
654
|
+
} : void 0, {
|
|
655
655
|
...apiGlobals,
|
|
656
656
|
[apiGlobalName]: {
|
|
657
657
|
value: apiObject,
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -405,7 +405,7 @@ async function createSandbox(QuickJS, requireLookup = {}, globals = {}, debug =
|
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
require$1("dotenv").config();
|
|
408
|
-
const openai = new openai$1.OpenAI();
|
|
408
|
+
const openai = new openai$1.OpenAI({ baseURL: process.env.OPENAI_API_BASE_URL || void 0, apiKey: process.env.OPENAI_API_KEY || void 0 });
|
|
409
409
|
let QuickJS = null;
|
|
410
410
|
const wrapCode = (apiGlobalName, apiFileDefPath, code) => `
|
|
411
411
|
(async () => {
|
|
@@ -590,9 +590,9 @@ async function createWithAPI(options) {
|
|
|
590
590
|
};
|
|
591
591
|
}
|
|
592
592
|
}
|
|
593
|
-
const { vm, checkCode } = await createSandbox(QuickJS, {
|
|
593
|
+
const { vm, checkCode } = await createSandbox(QuickJS, apiExports ? {
|
|
594
594
|
[apiDefFilePath]: apiExports
|
|
595
|
-
}, {
|
|
595
|
+
} : void 0, {
|
|
596
596
|
...apiGlobals,
|
|
597
597
|
[apiGlobalName]: {
|
|
598
598
|
value: apiObject,
|
|
@@ -649,9 +649,9 @@ async function createWithAPI(options) {
|
|
|
649
649
|
};
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
const { vm, runCode: runTask, isAsyncProcessRunning } = await createSandbox(QuickJS, {
|
|
652
|
+
const { vm, runCode: runTask, isAsyncProcessRunning } = await createSandbox(QuickJS, apiExports ? {
|
|
653
653
|
[apiDefFilePath]: apiExports
|
|
654
|
-
}, {
|
|
654
|
+
} : void 0, {
|
|
655
655
|
...apiGlobals,
|
|
656
656
|
[apiGlobalName]: {
|
|
657
657
|
value: apiObject,
|
package/dist/index.mjs
CHANGED
|
@@ -383,7 +383,7 @@ async function createSandbox(QuickJS, requireLookup = {}, globals = {}, debug =
|
|
|
383
383
|
}
|
|
384
384
|
|
|
385
385
|
require$1("dotenv").config();
|
|
386
|
-
const openai = new OpenAI();
|
|
386
|
+
const openai = new OpenAI({ baseURL: process.env.OPENAI_API_BASE_URL || void 0, apiKey: process.env.OPENAI_API_KEY || void 0 });
|
|
387
387
|
let QuickJS = null;
|
|
388
388
|
const wrapCode = (apiGlobalName, apiFileDefPath, code) => `
|
|
389
389
|
(async () => {
|
|
@@ -568,9 +568,9 @@ async function createWithAPI(options) {
|
|
|
568
568
|
};
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
const { vm, checkCode } = await createSandbox(QuickJS, {
|
|
571
|
+
const { vm, checkCode } = await createSandbox(QuickJS, apiExports ? {
|
|
572
572
|
[apiDefFilePath]: apiExports
|
|
573
|
-
}, {
|
|
573
|
+
} : void 0, {
|
|
574
574
|
...apiGlobals,
|
|
575
575
|
[apiGlobalName]: {
|
|
576
576
|
value: apiObject,
|
|
@@ -627,9 +627,9 @@ async function createWithAPI(options) {
|
|
|
627
627
|
};
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
const { vm, runCode: runTask, isAsyncProcessRunning } = await createSandbox(QuickJS, {
|
|
630
|
+
const { vm, runCode: runTask, isAsyncProcessRunning } = await createSandbox(QuickJS, apiExports ? {
|
|
631
631
|
[apiDefFilePath]: apiExports
|
|
632
|
-
}, {
|
|
632
|
+
} : void 0, {
|
|
633
633
|
...apiGlobals,
|
|
634
634
|
[apiGlobalName]: {
|
|
635
635
|
value: apiObject,
|