supercompat 3.14.0 → 3.14.1

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
@@ -9449,7 +9449,7 @@ var steps3 = function(param) {
9449
9449
  };
9450
9450
  // src/adapters/storage/azureAgentsStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
9451
9451
  var import_dayjs27 = __toESM(require("dayjs"), 1);
9452
- function convertAzureEventToOpenAI(azureEvent, assistantId) {
9452
+ function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
9453
9453
  var event = azureEvent.event, data = azureEvent.data;
9454
9454
  var eventType = event;
9455
9455
  if (eventType.startsWith("thread.run.") && !eventType.startsWith("thread.run.step.")) {
@@ -9624,7 +9624,7 @@ function convertAzureEventToOpenAI(azureEvent, assistantId) {
9624
9624
  };
9625
9625
  } else if (tc.type === "function") {
9626
9626
  var _tc_function, _tc_function1, _tc_function2;
9627
- var _tc_index2;
9627
+ var _tc_index2, _tc_function_output, _ref;
9628
9628
  return {
9629
9629
  index: (_tc_index2 = tc.index) !== null && _tc_index2 !== void 0 ? _tc_index2 : 0,
9630
9630
  id: tc.id,
@@ -9632,7 +9632,7 @@ function convertAzureEventToOpenAI(azureEvent, assistantId) {
9632
9632
  function: {
9633
9633
  name: ((_tc_function = tc.function) === null || _tc_function === void 0 ? void 0 : _tc_function.name) || "",
9634
9634
  arguments: ((_tc_function1 = tc.function) === null || _tc_function1 === void 0 ? void 0 : _tc_function1.arguments) || "",
9635
- output: ((_tc_function2 = tc.function) === null || _tc_function2 === void 0 ? void 0 : _tc_function2.output) || null
9635
+ output: (_ref = (_tc_function_output = (_tc_function2 = tc.function) === null || _tc_function2 === void 0 ? void 0 : _tc_function2.output) !== null && _tc_function_output !== void 0 ? _tc_function_output : outputsMap.get(tc.id)) !== null && _ref !== void 0 ? _ref : null
9636
9636
  }
9637
9637
  };
9638
9638
  }
@@ -9711,13 +9711,14 @@ function convertAzureEventToOpenAI(azureEvent, assistantId) {
9711
9711
  };
9712
9712
  } else if (tc.type === "function") {
9713
9713
  var _tc_function, _tc_function1, _tc_function2;
9714
+ var _tc_function_output, _ref;
9714
9715
  return {
9715
9716
  id: tc.id,
9716
9717
  type: "function",
9717
9718
  function: {
9718
9719
  name: ((_tc_function = tc.function) === null || _tc_function === void 0 ? void 0 : _tc_function.name) || "",
9719
9720
  arguments: ((_tc_function1 = tc.function) === null || _tc_function1 === void 0 ? void 0 : _tc_function1.arguments) || "",
9720
- output: ((_tc_function2 = tc.function) === null || _tc_function2 === void 0 ? void 0 : _tc_function2.output) || null
9721
+ output: (_ref = (_tc_function_output = (_tc_function2 = tc.function) === null || _tc_function2 === void 0 ? void 0 : _tc_function2.output) !== null && _tc_function_output !== void 0 ? _tc_function_output : outputsMap.get(tc.id)) !== null && _ref !== void 0 ? _ref : null
9721
9722
  }
9722
9723
  };
9723
9724
  }
@@ -9771,7 +9772,7 @@ var post23 = function(param) {
9771
9772
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
9772
9773
  return function(urlString, options) {
9773
9774
  return _async_to_generator(function() {
9774
- var url, _url_pathname_match, threadId, runId, body, tool_outputs, stream, existingRun, assistantId, submitResponse, streamRun, readableStream, events, finalRun;
9775
+ var url, _url_pathname_match, threadId, runId, body, tool_outputs, stream, outputsMap, existingRun, assistantId, submitResponse, streamRun, readableStream, events, finalRun;
9775
9776
  return _ts_generator(this, function(_state) {
9776
9777
  switch(_state.label){
9777
9778
  case 0:
@@ -9782,6 +9783,12 @@ var post23 = function(param) {
9782
9783
  }
9783
9784
  body = JSON.parse(options.body);
9784
9785
  tool_outputs = body.tool_outputs, stream = body.stream;
9786
+ outputsMap = new Map(tool_outputs.map(function(output) {
9787
+ return [
9788
+ output.tool_call_id,
9789
+ output.output
9790
+ ];
9791
+ }));
9785
9792
  return [
9786
9793
  4,
9787
9794
  Promise.all(tool_outputs.map(function(output) {
@@ -9859,7 +9866,7 @@ var post23 = function(param) {
9859
9866
  ];
9860
9867
  _value = _step.value;
9861
9868
  azureEvent = _value;
9862
- openaiEvent = convertAzureEventToOpenAI(azureEvent, assistantId);
9869
+ openaiEvent = convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap);
9863
9870
  if (!openaiEvent) return [
9864
9871
  3,
9865
9872
  6