@empiricalrun/llm
Advanced tools
Comparing version 0.9.0 to 0.9.1
# @empiricalrun/llm | ||
## 0.9.1 | ||
### Patch Changes | ||
- be30850: fix: expose input/output tokens from LLM class | ||
## 0.9.0 | ||
@@ -4,0 +10,0 @@ |
@@ -15,2 +15,4 @@ import { LangfuseGenerationClient, LangfuseSpanClient, LangfuseTraceClient } from "langfuse"; | ||
private _maxTokens; | ||
completionTokens: number; | ||
promptTokens: number; | ||
constructor({ trace, provider, providerApiKey, traceName, maxTokens, defaultModel, }: { | ||
@@ -17,0 +19,0 @@ trace?: TraceClient; |
@@ -24,2 +24,4 @@ "use strict"; | ||
_maxTokens; | ||
completionTokens = 0; | ||
promptTokens = 0; | ||
constructor({ trace, provider, providerApiKey, traceName = "get-llm-result", maxTokens, defaultModel, }) { | ||
@@ -88,2 +90,4 @@ this._trace = trace; | ||
} | ||
this.completionTokens = completion?.usage?.completion_tokens || 0; | ||
this.promptTokens = completion?.usage?.prompt_tokens || 0; | ||
this._usedTokens += completion?.usage?.total_tokens || 0; | ||
@@ -90,0 +94,0 @@ return output; |
{ | ||
"name": "@empiricalrun/llm", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
150998
555