@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 +8 -4
- package/index.cjs.map +1 -1
- package/index.d.cts +2 -0
- package/index.d.ts +2 -0
- package/index.js +8 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
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 (
|
|
6321
|
+
if (typeof content === "string" && content.trim() !== "") {
|
|
6322
|
+
;
|
|
6321
6323
|
chat.value.content = content;
|
|
6322
6324
|
}
|
|
6323
|
-
if (
|
|
6325
|
+
if (typeof name === "string" && name.trim() !== "") {
|
|
6326
|
+
;
|
|
6324
6327
|
chat.value.name = name;
|
|
6325
6328
|
}
|
|
6326
|
-
if (
|
|
6329
|
+
if (Array.isArray(functionCalls) && functionCalls.length > 0) {
|
|
6330
|
+
;
|
|
6327
6331
|
chat.value.functionCalls = functionCalls;
|
|
6328
6332
|
}
|
|
6329
6333
|
log();
|