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.js CHANGED
@@ -9329,7 +9329,7 @@ var steps3 = function(param) {
9329
9329
  };
9330
9330
  // src/adapters/storage/azureAgentsStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
9331
9331
  import dayjs27 from "dayjs";
9332
- function convertAzureEventToOpenAI(azureEvent, assistantId) {
9332
+ function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
9333
9333
  var event = azureEvent.event, data = azureEvent.data;
9334
9334
  var eventType = event;
9335
9335
  if (eventType.startsWith("thread.run.") && !eventType.startsWith("thread.run.step.")) {
@@ -9504,7 +9504,7 @@ function convertAzureEventToOpenAI(azureEvent, assistantId) {
9504
9504
  };
9505
9505
  } else if (tc.type === "function") {
9506
9506
  var _tc_function, _tc_function1, _tc_function2;
9507
- var _tc_index2;
9507
+ var _tc_index2, _tc_function_output, _ref;
9508
9508
  return {
9509
9509
  index: (_tc_index2 = tc.index) !== null && _tc_index2 !== void 0 ? _tc_index2 : 0,
9510
9510
  id: tc.id,
@@ -9512,7 +9512,7 @@ function convertAzureEventToOpenAI(azureEvent, assistantId) {
9512
9512
  function: {
9513
9513
  name: ((_tc_function = tc.function) === null || _tc_function === void 0 ? void 0 : _tc_function.name) || "",
9514
9514
  arguments: ((_tc_function1 = tc.function) === null || _tc_function1 === void 0 ? void 0 : _tc_function1.arguments) || "",
9515
- output: ((_tc_function2 = tc.function) === null || _tc_function2 === void 0 ? void 0 : _tc_function2.output) || null
9515
+ 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
9516
9516
  }
9517
9517
  };
9518
9518
  }
@@ -9591,13 +9591,14 @@ function convertAzureEventToOpenAI(azureEvent, assistantId) {
9591
9591
  };
9592
9592
  } else if (tc.type === "function") {
9593
9593
  var _tc_function, _tc_function1, _tc_function2;
9594
+ var _tc_function_output, _ref;
9594
9595
  return {
9595
9596
  id: tc.id,
9596
9597
  type: "function",
9597
9598
  function: {
9598
9599
  name: ((_tc_function = tc.function) === null || _tc_function === void 0 ? void 0 : _tc_function.name) || "",
9599
9600
  arguments: ((_tc_function1 = tc.function) === null || _tc_function1 === void 0 ? void 0 : _tc_function1.arguments) || "",
9600
- output: ((_tc_function2 = tc.function) === null || _tc_function2 === void 0 ? void 0 : _tc_function2.output) || null
9601
+ 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
9601
9602
  }
9602
9603
  };
9603
9604
  }
@@ -9651,7 +9652,7 @@ var post23 = function(param) {
9651
9652
  var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
9652
9653
  return function(urlString, options) {
9653
9654
  return _async_to_generator(function() {
9654
- var url, _url_pathname_match, threadId, runId, body, tool_outputs, stream, existingRun, assistantId, submitResponse, streamRun, readableStream, events, finalRun;
9655
+ var url, _url_pathname_match, threadId, runId, body, tool_outputs, stream, outputsMap, existingRun, assistantId, submitResponse, streamRun, readableStream, events, finalRun;
9655
9656
  return _ts_generator(this, function(_state) {
9656
9657
  switch(_state.label){
9657
9658
  case 0:
@@ -9662,6 +9663,12 @@ var post23 = function(param) {
9662
9663
  }
9663
9664
  body = JSON.parse(options.body);
9664
9665
  tool_outputs = body.tool_outputs, stream = body.stream;
9666
+ outputsMap = new Map(tool_outputs.map(function(output) {
9667
+ return [
9668
+ output.tool_call_id,
9669
+ output.output
9670
+ ];
9671
+ }));
9665
9672
  return [
9666
9673
  4,
9667
9674
  Promise.all(tool_outputs.map(function(output) {
@@ -9739,7 +9746,7 @@ var post23 = function(param) {
9739
9746
  ];
9740
9747
  _value = _step.value;
9741
9748
  azureEvent = _value;
9742
- openaiEvent = convertAzureEventToOpenAI(azureEvent, assistantId);
9749
+ openaiEvent = convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap);
9743
9750
  if (!openaiEvent) return [
9744
9751
  3,
9745
9752
  6