@empiricalrun/llm
Advanced tools
Comparing version 0.9.21 to 0.9.22
# @empiricalrun/llm | ||
## 0.9.22 | ||
### Patch Changes | ||
- 557324f: fix: langfuse token calculation for cost | ||
## 0.9.21 | ||
@@ -4,0 +10,0 @@ |
@@ -86,3 +86,2 @@ "use strict"; | ||
const output = completion?.choices[0]?.message; | ||
generation?.end({ output }); | ||
if (completion && !completion.usage?.total_tokens) { | ||
@@ -94,2 +93,12 @@ console.warn("No usage.total_tokens in completion"); | ||
this._usedTokens += completion?.usage?.total_tokens || 0; | ||
generation?.end({ | ||
output, | ||
usage: this.completionTokens && this.promptTokens | ||
? { | ||
input: this.promptTokens, | ||
output: this.completionTokens, | ||
unit: "TOKENS", | ||
} | ||
: undefined, | ||
}); | ||
return output; | ||
@@ -96,0 +105,0 @@ } |
{ | ||
"name": "@empiricalrun/llm", | ||
"version": "0.9.21", | ||
"version": "0.9.22", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "exports": { |
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
48542
906