@axiom-lattice/client-sdk 7.2.1 → 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/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);