@ax-llm/ax 12.0.15 → 12.0.16

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/index.cjs CHANGED
@@ -6298,9 +6298,10 @@ var MemoryImpl = class {
6298
6298
  }
6299
6299
  }
6300
6300
  };
6301
- if (!lastItem || lastItem.role !== "assistant") {
6301
+ if (!lastItem || lastItem.role !== "assistant" || lastItem.role === "assistant" && !lastItem.updatable) {
6302
6302
  this.data.push({
6303
6303
  role: "assistant",
6304
+ updatable: true,
6304
6305
  chat: [
6305
6306
  { index, value: structuredClone({ content, name, functionCalls }) }
6306
6307
  ]
@@ -6317,13 +6318,16 @@ var MemoryImpl = class {
6317
6318
  log();
6318
6319
  return;
6319
6320
  }
6320
- if ("content" in chat.value && typeof content === "string" && content.trim() !== "") {
6321
+ if (typeof content === "string" && content.trim() !== "") {
6322
+ ;
6321
6323
  chat.value.content = content;
6322
6324
  }
6323
- if ("name" in chat.value && name && name.trim() !== "") {
6325
+ if (typeof name === "string" && name.trim() !== "") {
6326
+ ;
6324
6327
  chat.value.name = name;
6325
6328
  }
6326
- if ("functionCalls" in chat.value && functionCalls && functionCalls.length > 0) {
6329
+ if (Array.isArray(functionCalls) && functionCalls.length > 0) {
6330
+ ;
6327
6331
  chat.value.functionCalls = functionCalls;
6328
6332
  }
6329
6333
  log();