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