supercompat 3.6.1 → 3.7.0

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.cjs CHANGED
@@ -6759,6 +6759,14 @@ function serializeItemAsMessageCreationRunStep(param) {
6759
6759
  // src/lib/items/serializeItemAsFunctionCallRunStep.ts
6760
6760
  var import_dayjs13 = __toESM(require("dayjs"), 1);
6761
6761
  var import_radash19 = require("radash");
6762
+ var serializeFunctionCallOutput = function(param) {
6763
+ var functionCallOutput = param.functionCallOutput;
6764
+ if (!functionCallOutput) return null;
6765
+ if (typeof functionCallOutput.output === "string") {
6766
+ return functionCallOutput.output;
6767
+ }
6768
+ return JSON.stringify(functionCallOutput.output);
6769
+ };
6762
6770
  var serializeItemAsFunctionCallRunStep = function(param) {
6763
6771
  var item = param.item, items = param.items, threadId = param.threadId, openaiAssistant = param.openaiAssistant, _param_runId = param.runId, runId = _param_runId === void 0 ? "run_".concat((0, import_radash19.uid)(24)) : _param_runId, tmp = param.status, status3 = tmp === void 0 ? "completed" : tmp, _param_completedAt = param.completedAt, completedAt = _param_completedAt === void 0 ? (0, import_dayjs13.default)().unix() : _param_completedAt;
6764
6772
  var itemId = typeof item.id === "string" ? item.id : "item_".concat((0, import_radash19.uid)(18));
@@ -6787,7 +6795,9 @@ var serializeItemAsFunctionCallRunStep = function(param) {
6787
6795
  function: {
6788
6796
  name: item.name,
6789
6797
  arguments: item.arguments,
6790
- output: functionCallOutput ? functionCallOutput.output : null
6798
+ output: serializeFunctionCallOutput({
6799
+ functionCallOutput: functionCallOutput
6800
+ })
6791
6801
  }
6792
6802
  };
6793
6803
  return _object_spread_props(_object_spread({}, base), {