@alpic80/rivet-ai-sdk-provider 2.0.1 → 2.0.2

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
@@ -1109,7 +1109,7 @@ prepare tools input:${printObject(tools)}`);
1109
1109
  }
1110
1110
 
1111
1111
  // src/version.ts
1112
- var VERSION = true ? "2.0.1" : "0.0.0-test";
1112
+ var VERSION = true ? "2.0.2" : "0.0.0-test";
1113
1113
 
1114
1114
  // src/post-to-api.ts
1115
1115
  var getOriginalFetch = () => globalThis.fetch;
@@ -1761,7 +1761,7 @@ function createRivetEventSourceResponseHandler(id, model) {
1761
1761
  }));
1762
1762
  }
1763
1763
  function mapRivetEventToOpenAIChunk(eventData, id, model) {
1764
- var _a15, _b, _c, _d, _e, _f, _g;
1764
+ var _a15, _b, _c, _d, _e, _f, _g, _h;
1765
1765
  const eventType = eventData.type;
1766
1766
  switch (eventType) {
1767
1767
  case "partialOutput":
@@ -1782,6 +1782,24 @@ function mapRivetEventToOpenAIChunk(eventData, id, model) {
1782
1782
  ],
1783
1783
  usage: void 0
1784
1784
  };
1785
+ case "nodeFinish":
1786
+ return {
1787
+ id,
1788
+ created: Math.floor(Date.now() / 1e3),
1789
+ model,
1790
+ choices: [
1791
+ {
1792
+ delta: {
1793
+ role: "assistant",
1794
+ content: (_b = eventData.delta) != null ? _b : "",
1795
+ tool_calls: void 0
1796
+ },
1797
+ finish_reason: null,
1798
+ index: 0
1799
+ }
1800
+ ],
1801
+ usage: void 0
1802
+ };
1785
1803
  case "done":
1786
1804
  return {
1787
1805
  id,
@@ -1791,14 +1809,14 @@ function mapRivetEventToOpenAIChunk(eventData, id, model) {
1791
1809
  {
1792
1810
  delta: {
1793
1811
  role: "assistant",
1794
- content: (_d = (_c = (_b = eventData.graphOutput) == null ? void 0 : _b.response) == null ? void 0 : _c.value) != null ? _d : "",
1812
+ content: (_e = (_d = (_c = eventData.graphOutput) == null ? void 0 : _c.response) == null ? void 0 : _d.value) != null ? _e : "",
1795
1813
  tool_calls: void 0
1796
1814
  },
1797
1815
  finish_reason: "stop",
1798
1816
  index: 0
1799
1817
  }
1800
1818
  ],
1801
- usage: toOpenAIUsage((_g = (_f = (_e = eventData.graphOutput.usages) == null ? void 0 : _e.value) == null ? void 0 : _f[0]) == null ? void 0 : _g.value)
1819
+ usage: toOpenAIUsage((_h = (_g = (_f = eventData.graphOutput.usages) == null ? void 0 : _f.value) == null ? void 0 : _g[0]) == null ? void 0 : _h.value)
1802
1820
  };
1803
1821
  default:
1804
1822
  return {