190proof 1.0.21 → 1.0.23
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.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -31538,7 +31538,7 @@ async function callOpenAiWithRetries(identifier, openAiPayload, openAiConfig, re
|
|
|
31538
31538
|
);
|
|
31539
31539
|
}
|
|
31540
31540
|
async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTimeoutMs) {
|
|
31541
|
-
var _a3, _b, _c, _d, _e, _f;
|
|
31541
|
+
var _a3, _b, _c, _d, _e, _f, _g, _h;
|
|
31542
31542
|
const functionNames = openAiPayload.tools ? new Set(openAiPayload.tools.map((fn) => fn.function.name)) : null;
|
|
31543
31543
|
if (!openAiConfig) {
|
|
31544
31544
|
const defaultOpenAIBaseUrl = (
|
|
@@ -31690,14 +31690,14 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
|
|
|
31690
31690
|
);
|
|
31691
31691
|
continue;
|
|
31692
31692
|
}
|
|
31693
|
-
const dFn = (_c = (_b = (_a3 = json.choices) == null ? void 0 : _a3[0]) == null ? void 0 : _b.delta) == null ? void 0 : _c.
|
|
31693
|
+
const dFn = (_e = (_d = (_c = (_b = (_a3 = json.choices) == null ? void 0 : _a3[0]) == null ? void 0 : _b.delta) == null ? void 0 : _c.tool_calls) == null ? void 0 : _d[0]) == null ? void 0 : _e.function;
|
|
31694
31694
|
if (dFn) {
|
|
31695
31695
|
if (dFn.name)
|
|
31696
31696
|
functionCallName += dFn.name;
|
|
31697
31697
|
if (dFn.arguments)
|
|
31698
31698
|
functionCallArgs += dFn.arguments;
|
|
31699
31699
|
}
|
|
31700
|
-
const text = (
|
|
31700
|
+
const text = (_h = (_g = (_f = json.choices) == null ? void 0 : _f[0]) == null ? void 0 : _g.delta) == null ? void 0 : _h.content;
|
|
31701
31701
|
if (text) {
|
|
31702
31702
|
paragraph += text;
|
|
31703
31703
|
}
|
|
@@ -32013,10 +32013,11 @@ async function prepareOpenAIPayload(payload) {
|
|
|
32013
32013
|
openAIContentBlocks.push({
|
|
32014
32014
|
type: "image_url",
|
|
32015
32015
|
image_url: {
|
|
32016
|
-
url:
|
|
32017
|
-
|
|
32018
|
-
|
|
32019
|
-
|
|
32016
|
+
url: file.url
|
|
32017
|
+
// url: `data:image/png;base64,${await getNormalizedBase64PNG(
|
|
32018
|
+
// file.url,
|
|
32019
|
+
// file.mimeType
|
|
32020
|
+
// )}`,
|
|
32020
32021
|
}
|
|
32021
32022
|
});
|
|
32022
32023
|
} else if (file.data) {
|