190proof 1.0.33 → 1.0.35
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 +13 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31549,7 +31549,7 @@ async function callOpenAiWithRetries(identifier, openAiPayload, openAiConfig, re
|
|
|
31549
31549
|
);
|
|
31550
31550
|
}
|
|
31551
31551
|
async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTimeoutMs) {
|
|
31552
|
-
var _a3, _b, _c, _d
|
|
31552
|
+
var _a3, _b, _c, _d;
|
|
31553
31553
|
const functionNames = openAiPayload.tools ? new Set(openAiPayload.tools.map((fn) => fn.function.name)) : null;
|
|
31554
31554
|
if (!openAiConfig) {
|
|
31555
31555
|
const defaultOpenAIBaseUrl = (
|
|
@@ -31701,14 +31701,19 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
|
|
|
31701
31701
|
);
|
|
31702
31702
|
continue;
|
|
31703
31703
|
}
|
|
31704
|
-
const
|
|
31705
|
-
|
|
31706
|
-
|
|
31707
|
-
|
|
31708
|
-
if (
|
|
31709
|
-
|
|
31704
|
+
const toolCall = (_a3 = json.choices[0].tool_calls) == null ? void 0 : _a3[0];
|
|
31705
|
+
console.log(identifier, "Tool call:", toolCall);
|
|
31706
|
+
if (toolCall) {
|
|
31707
|
+
const toolCallIndex = toolCall.index || 0;
|
|
31708
|
+
if (toolCallIndex === 0) {
|
|
31709
|
+
const dFn = toolCall.function || {};
|
|
31710
|
+
if (dFn.name)
|
|
31711
|
+
functionCallName += dFn.name;
|
|
31712
|
+
if (dFn.arguments)
|
|
31713
|
+
functionCallArgs += dFn.arguments;
|
|
31714
|
+
}
|
|
31710
31715
|
}
|
|
31711
|
-
const text = (
|
|
31716
|
+
const text = (_d = (_c = (_b = json.choices) == null ? void 0 : _b[0]) == null ? void 0 : _c.delta) == null ? void 0 : _d.content;
|
|
31712
31717
|
if (text) {
|
|
31713
31718
|
paragraph += text;
|
|
31714
31719
|
}
|