190proof 1.0.15 → 1.0.17

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
@@ -31525,6 +31525,7 @@ async function callOpenAiWithRetries(identifier, openAiPayload, openAiConfig, re
31525
31525
  openAiPayload.function_call = "none";
31526
31526
  }
31527
31527
  }
31528
+ console.error(error);
31528
31529
  console.error(
31529
31530
  identifier,
31530
31531
  `Retrying due to error: received bad response from OpenAI API [${openAiConfig == null ? void 0 : openAiConfig.service}-${openAiPayload.model}-${openAiConfig == null ? void 0 : openAiConfig.orgId}]: ${error.message} - ${JSON.stringify((_b = error.response) == null ? void 0 : _b.data)}`
@@ -31542,6 +31543,7 @@ async function callOpenAiWithRetries(identifier, openAiPayload, openAiConfig, re
31542
31543
  );
31543
31544
  }
31544
31545
  async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTimeoutMs) {
31546
+ var _a3, _b, _c, _d, _e, _f;
31545
31547
  const functionNames = openAiPayload.functions ? new Set(openAiPayload.functions.map((fn) => fn.name)) : null;
31546
31548
  if (!openAiConfig) {
31547
31549
  const defaultOpenAIBaseUrl = (
@@ -31681,14 +31683,14 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
31681
31683
  );
31682
31684
  continue;
31683
31685
  }
31684
- const dFn = json.choices[0].delta.function_call;
31686
+ const dFn = (_c = (_b = (_a3 = json.choices) == null ? void 0 : _a3[0]) == null ? void 0 : _b.delta) == null ? void 0 : _c.function_call;
31685
31687
  if (dFn) {
31686
31688
  if (dFn.name)
31687
31689
  functionCallName += dFn.name;
31688
31690
  if (dFn.arguments)
31689
31691
  functionCallArgs += dFn.arguments;
31690
31692
  }
31691
- const text = json.choices[0].delta.content;
31693
+ const text = (_f = (_e = (_d = json.choices) == null ? void 0 : _d[0]) == null ? void 0 : _e.delta) == null ? void 0 : _f.content;
31692
31694
  if (text) {
31693
31695
  paragraph += text;
31694
31696
  }