teodor-new-chat-ui 4.3.706 → 4.3.707
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.esm.js +3 -26
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +15 -15
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3854,7 +3854,7 @@ function Mo(e) {
|
|
|
3854
3854
|
const a = i.toolCallId || Array.isArray(i.toolCalls) && ((s = i.toolCalls[0]) == null ? void 0 : s.id) || i.tool_call_id;
|
|
3855
3855
|
a && n.set(a, i);
|
|
3856
3856
|
}
|
|
3857
|
-
|
|
3857
|
+
return t.map((i, a) => {
|
|
3858
3858
|
if (i.role !== "assistant" || !Array.isArray(i.toolCalls) || i.toolCalls.length === 0)
|
|
3859
3859
|
return i;
|
|
3860
3860
|
const c = i.toolCalls.map((l) => {
|
|
@@ -3875,32 +3875,9 @@ function Mo(e) {
|
|
|
3875
3875
|
};
|
|
3876
3876
|
});
|
|
3877
3877
|
return { ...i, toolCalls: c };
|
|
3878
|
-
})
|
|
3879
|
-
for (const i of r) {
|
|
3880
|
-
if (!i) continue;
|
|
3881
|
-
const a = o[o.length - 1];
|
|
3882
|
-
if (a && a.role === "assistant" && i.role === "assistant" && // Strictly require same name to merge (different agents stay separate)
|
|
3883
|
-
a.name === i.name && a.name !== null && // Plus same model if available
|
|
3884
|
-
a.model === i.model) {
|
|
3885
|
-
const l = Array.isArray(a.content) ? a.content : [{ type: "text", text: String(a.content || "") }], u = Array.isArray(i.content) ? i.content : [{ type: "text", text: String(i.content || "") }], f = [...l, ...u], h = [
|
|
3886
|
-
...Array.isArray(a.toolCalls) ? a.toolCalls : [],
|
|
3887
|
-
...Array.isArray(i.toolCalls) ? i.toolCalls : []
|
|
3888
|
-
];
|
|
3889
|
-
o[o.length - 1] = {
|
|
3890
|
-
...i,
|
|
3891
|
-
// Use newest metadata (ID, etc)
|
|
3892
|
-
content: f,
|
|
3893
|
-
toolCalls: h.length > 0 ? h : void 0,
|
|
3894
|
-
artifact: i.artifact || a.artifact,
|
|
3895
|
-
checkpointId: i.checkpointId || a.checkpointId,
|
|
3896
|
-
checkpointNs: i.checkpointNs || a.checkpointNs
|
|
3897
|
-
};
|
|
3898
|
-
} else
|
|
3899
|
-
o.push(i);
|
|
3900
|
-
}
|
|
3901
|
-
return o.filter((i) => {
|
|
3878
|
+
}).filter((i) => {
|
|
3902
3879
|
var p;
|
|
3903
|
-
if (!i
|
|
3880
|
+
if (!i) return !1;
|
|
3904
3881
|
if (i.role !== "assistant") return !0;
|
|
3905
3882
|
const a = i.content, c = typeof a == "string" ? a.trim().length > 0 : Array.isArray(a) && a.some((m) => {
|
|
3906
3883
|
var g;
|