@axiom-lattice/client-sdk 7.2.0 → 8.0.0
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/README.md +11 -0
- package/dist/ChunkMessageMerger.d.ts.map +1 -1
- package/dist/ChunkMessageMerger.js +16 -0
- package/dist/ChunkMessageMerger.js.map +1 -1
- package/dist/__tests__/ChunkMessageMerger.test.js +83 -0
- package/dist/__tests__/ChunkMessageMerger.test.js.map +1 -1
- package/dist/export-import.d.ts +7 -2
- package/dist/export-import.d.ts.map +1 -1
- package/dist/export-import.js.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -0
- package/dist/index.mjs.map +1 -1
- package/dist/workspace-client.d.ts +1 -1
- package/dist/workspace-client.d.ts.map +1 -1
- package/dist/workspace-client.js.map +1 -1
- package/package.json +5 -2
package/dist/index.mjs
CHANGED
|
@@ -5898,6 +5898,19 @@ function createSimpleMessageMerger() {
|
|
|
5898
5898
|
const newContent = (message.content || "") + chunk.data.content;
|
|
5899
5899
|
message = replaceMessage(chunk.data.id, { content: newContent }) || message;
|
|
5900
5900
|
}
|
|
5901
|
+
if (message.role === "ai") {
|
|
5902
|
+
const reasoningChunk = chunk.data.additional_kwargs?.reasoning_content ?? chunk.data.reasoning_content;
|
|
5903
|
+
if (typeof reasoningChunk === "string" && reasoningChunk.length > 0) {
|
|
5904
|
+
const newReasoning = (message.reasoning_content || "") + reasoningChunk;
|
|
5905
|
+
message = replaceMessage(chunk.data.id, { reasoning_content: newReasoning }) || message;
|
|
5906
|
+
}
|
|
5907
|
+
const reasoningDuration = chunk.data.additional_kwargs?.reasoning_duration_ms ?? chunk.data.reasoning_duration_ms;
|
|
5908
|
+
if (typeof reasoningDuration === "number" && Number.isFinite(reasoningDuration)) {
|
|
5909
|
+
message = replaceMessage(chunk.data.id, {
|
|
5910
|
+
reasoning_duration_ms: Math.max(0, Math.round(reasoningDuration))
|
|
5911
|
+
}) || message;
|
|
5912
|
+
}
|
|
5913
|
+
}
|
|
5901
5914
|
if (message.role === "ai" && chunk.data.tool_calls && chunk.data.tool_calls.length > 0) {
|
|
5902
5915
|
for (const toolCall of chunk.data.tool_calls) {
|
|
5903
5916
|
toolId_MessageIdMap.set(toolCall.id, message.id);
|