@empiricalrun/llm
Advanced tools
Comparing version 0.2.0 to 0.3.0
# @empiricalrun/llm | ||
## 0.3.0 | ||
### Minor Changes | ||
- 5293f9e: feat: expose span client in startSpan and change generation usage type | ||
## 0.2.0 | ||
@@ -4,0 +10,0 @@ |
@@ -16,2 +16,3 @@ import OpenAI from "openai"; | ||
export { flushAllTraces, getPrompt, LLMTracing }; | ||
export type { LLMModel, LLMProvider, ModelParameters }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import OpenAI from "openai"; | ||
import { LangfuseSpanClient } from "langfuse"; | ||
import { LLMTracingProps } from "../types"; | ||
@@ -23,2 +23,3 @@ export default class LLMTracing { | ||
}) => void; | ||
span: LangfuseSpanClient; | ||
}; | ||
@@ -31,5 +32,5 @@ startGeneration({ name, model, parameters, input, }: { | ||
}): { | ||
end: ({ output, usage, }: { | ||
end: ({ output, usage }: { | ||
output: any; | ||
usage?: OpenAI.Completions.CompletionUsage | undefined; | ||
usage?: any; | ||
}) => void; | ||
@@ -36,0 +37,0 @@ }; |
@@ -39,2 +39,3 @@ "use strict"; | ||
}, | ||
span, | ||
}; | ||
@@ -51,12 +52,6 @@ } | ||
return { | ||
end: ({ output, usage, }) => { | ||
end: ({ output, usage }) => { | ||
generation.end({ | ||
output, | ||
usage: usage | ||
? { | ||
promptTokens: usage.prompt_tokens, | ||
completionTokens: usage.completion_tokens, | ||
totalTokens: usage.total_tokens, | ||
} | ||
: undefined, | ||
usage, | ||
}); | ||
@@ -63,0 +58,0 @@ }, |
{ | ||
"name": "@empiricalrun/llm", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
13605
246