@axiom-lattice/client-sdk 2.1.7 → 2.1.8
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/ChunkMessageMerger.d.ts.map +1 -1
- package/dist/ChunkMessageMerger.js +40 -27
- package/dist/ChunkMessageMerger.js.map +1 -1
- package/dist/index.js +2 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3032,31 +3032,10 @@ function createSimpleMessageMerger() {
|
|
|
3032
3032
|
}
|
|
3033
3033
|
}
|
|
3034
3034
|
function initialMessages(msgs) {
|
|
3035
|
-
messages = msgs;
|
|
3036
3035
|
messageMap.clear();
|
|
3037
|
-
messages.forEach((msg, index) => {
|
|
3038
|
-
if (msg.id) {
|
|
3039
|
-
messageMap.set(msg.id, index);
|
|
3040
|
-
}
|
|
3041
|
-
});
|
|
3042
3036
|
toolBuilders.clear();
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
const builders = /* @__PURE__ */ new Map();
|
|
3046
|
-
msg.tool_calls.forEach((toolCall, index) => {
|
|
3047
|
-
if (toolCall.id && toolCall.name) {
|
|
3048
|
-
const argsStr = typeof toolCall.args === "object" ? JSON.stringify(toolCall.args) : String(toolCall.args || "");
|
|
3049
|
-
builders.set(index, {
|
|
3050
|
-
id: toolCall.id,
|
|
3051
|
-
name: toolCall.name,
|
|
3052
|
-
args: argsStr
|
|
3053
|
-
});
|
|
3054
|
-
}
|
|
3055
|
-
});
|
|
3056
|
-
if (builders.size > 0) {
|
|
3057
|
-
toolBuilders.set(msg.id, builders);
|
|
3058
|
-
}
|
|
3059
|
-
}
|
|
3037
|
+
msgs.forEach((msg) => {
|
|
3038
|
+
push({ type: msg.role, data: msg });
|
|
3060
3039
|
});
|
|
3061
3040
|
}
|
|
3062
3041
|
function push(chunk) {
|