@genai-fi/nanogpt 1.6.0 → 1.6.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.
@@ -184,11 +184,11 @@ var D = class extends e {
184
184
  async _generate(e, t) {
185
185
  let n = !1;
186
186
  if (e?.rescore && this.outputConversation.length > 0) {
187
- let e = this.outputConversation.pop();
187
+ let e = this.outputConversation[this.outputConversation.length - 1];
188
188
  if (!e || !e._output) throw Error("No raw output found for the last conversation entry");
189
- this.rawOutput = e?._output;
189
+ this.rawOutput = e?._output, e.content = "";
190
190
  }
191
- this.outputConversation.length === 0 || this.outputConversation[this.outputConversation.length - 1]._completed || this.outputConversation[this.outputConversation.length - 1].role !== "assistant" && e?.nonConversational !== !0 || this.outputConversation[this.outputConversation.length - 1].role !== "text" && e?.nonConversational === !0 ? (this.outputConversation.push({
191
+ this.outputConversation.length === 0 || this.outputConversation[this.outputConversation.length - 1]._completed || this.outputConversation[this.outputConversation.length - 1].role !== "assistant" && e?.nonConversational !== !0 || this.outputConversation[this.outputConversation.length - 1].role !== "text" && e?.nonConversational === !0 ? (e?.rescore || this.outputConversation.push({
192
192
  role: e?.nonConversational === !0 ? "text" : "assistant",
193
193
  content: "",
194
194
  _timestamp: Date.now()
@@ -229,7 +229,7 @@ var D = class extends e {
229
229
  r._completed = !0;
230
230
  break;
231
231
  }
232
- t === a - 1 && a > 1 && (r._completed = !0, n.terminated = !0), r.content += n.text, r._output ||= [], r._output.push(n);
232
+ t === a - 1 && a > 1 && (r._completed = !0, n.terminated = !0), r.content += n.text, r._output ||= [], e?.rescore || r._output.push(n);
233
233
  }
234
234
  return i.dispose(), this.outputConversation;
235
235
  }
@@ -1,4 +1,4 @@
1
- import { t as e } from "../Generator-BcR_14Cj.js";
1
+ import { t as e } from "../Generator-8IK28IWR.js";
2
2
  import { t } from "../eventemitter3-wmfmOP_f.js";
3
3
  import { t as n } from "../v4-YCkfo8OR.js";
4
4
  // lib/api/responses.ts
@@ -1 +1 @@
1
- export { t as default, n as isConversation } from "../Generator-BcR_14Cj.js";
1
+ export { t as default, n as isConversation } from "../Generator-8IK28IWR.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genai-fi/nanogpt",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",