190proof 1.0.30 → 1.0.32

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 CHANGED
@@ -31702,13 +31702,15 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
31702
31702
  continue;
31703
31703
  }
31704
31704
  const toolCall = (_a3 = json.choices[0].tool_calls) == null ? void 0 : _a3[0];
31705
- const toolCallIndex = (toolCall == null ? void 0 : toolCall.index) || 0;
31706
- if (toolCallIndex === 0) {
31707
- const dFn = toolCall == null ? void 0 : toolCall.function;
31708
- if (dFn.name)
31709
- functionCallName += dFn.name;
31710
- if (dFn.arguments)
31711
- functionCallArgs += dFn.arguments;
31705
+ if (toolCall) {
31706
+ const toolCallIndex = toolCall.index || 0;
31707
+ if (toolCallIndex === 0) {
31708
+ const dFn = toolCall.function || {};
31709
+ if (dFn.name)
31710
+ functionCallName += dFn.name;
31711
+ if (dFn.arguments)
31712
+ functionCallArgs += dFn.arguments;
31713
+ }
31712
31714
  }
31713
31715
  const text = (_d = (_c = (_b = json.choices) == null ? void 0 : _b[0]) == null ? void 0 : _c.delta) == null ? void 0 : _d.content;
31714
31716
  if (text) {