Comparing version 3.29.0 to 3.29.1
@@ -152,3 +152,3 @@ 'use strict'; | ||
var version = "3.29.0"; | ||
var version = "3.29.1"; | ||
@@ -435,4 +435,8 @@ class Langfuse extends langfuseCore.LangfuseCore { | ||
let completionStartTime = null; | ||
let usage = null; | ||
for await (const rawChunk of response) { | ||
completionStartTime = completionStartTime ?? new Date(); | ||
if (typeof rawChunk === "object" && rawChunk != null && "usage" in rawChunk) { | ||
usage = rawChunk.usage; | ||
} | ||
const processedChunk = parseChunk(rawChunk); | ||
@@ -451,3 +455,8 @@ if (!processedChunk.isToolCall) { | ||
endTime: new Date(), | ||
completionStartTime | ||
completionStartTime, | ||
usage: usage ? { | ||
input: "prompt_tokens" in usage ? usage.prompt_tokens : undefined, | ||
output: "completion_tokens" in usage ? usage.completion_tokens : undefined, | ||
total: "total_tokens" in usage ? usage.total_tokens : undefined | ||
} : undefined | ||
}); | ||
@@ -454,0 +463,0 @@ if (!hasUserProvidedParent) { |
{ | ||
"name": "langfuse", | ||
"version": "3.29.0", | ||
"version": "3.29.1", | ||
"engines": { | ||
@@ -35,5 +35,5 @@ "node": ">=18" | ||
"dependencies": { | ||
"langfuse-core": "^3.29.0" | ||
"langfuse-core": "^3.29.1" | ||
}, | ||
"gitHead": "778d7c5cffb49140d97dbe154ff721bdb63e751c", | ||
"gitHead": "7961532988cdf5d4de810d3c783e4e98332578ad", | ||
"devDependencies": { | ||
@@ -40,0 +40,0 @@ "typedoc": "^0.26.8" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131263
1190
Updatedlangfuse-core@^3.29.1