autoevals
Advanced tools
Comparing version 0.0.40 to 0.0.41
@@ -70,10 +70,18 @@ "use strict"; | ||
// js/util.ts | ||
function currentSpanTraced(name, callback, args) { | ||
function currentSpanTraced(callback, args) { | ||
var _a; | ||
if (globalThis.__inherited_braintrust_state) { | ||
const currentSpan = globalThis.__inherited_braintrust_state.currentSpan.getStore(); | ||
return currentSpan.traced( | ||
name, | ||
(span) => callback(span.log.bind(span)), | ||
args | ||
); | ||
if (currentSpan.traced.length === 2) { | ||
return currentSpan.traced( | ||
(span) => callback(span.log.bind(span)), | ||
args | ||
); | ||
} else { | ||
return currentSpan.traced( | ||
(_a = args == null ? void 0 : args.name) != null ? _a : "subspan", | ||
(span) => callback(span.log.bind(span)), | ||
args | ||
); | ||
} | ||
} else { | ||
@@ -106,3 +114,2 @@ return callback(() => { | ||
return await currentSpanTraced( | ||
"OpenAI Completion", | ||
async (spanLog) => { | ||
@@ -135,3 +142,4 @@ var _a, _b, _c; | ||
return ret; | ||
} | ||
}, | ||
{ name: "OpenAI Completion" } | ||
); | ||
@@ -537,3 +545,2 @@ } | ||
return await currentSpanTraced( | ||
"OpenAI Embedding", | ||
async (spanLog) => { | ||
@@ -556,3 +563,4 @@ var _a, _b; | ||
return result; | ||
} | ||
}, | ||
{ name: "OpenAI Embedding" } | ||
); | ||
@@ -559,0 +567,0 @@ } |
{ | ||
"name": "autoevals", | ||
"version": "0.0.40", | ||
"version": "0.0.41", | ||
"description": "Universal library for evaluating AI models", | ||
@@ -44,3 +44,3 @@ "main": "./jsdist/index.js", | ||
"dependencies": { | ||
"@braintrust/core": "^0.0.6", | ||
"@braintrust/core": "^0.0.7", | ||
"@types/node": "^20.10.5", | ||
@@ -47,0 +47,0 @@ "compute-cosine-similarity": "^1.1.0", |
Sorry, the diff of this file is not supported yet
63043
1481
+ Added@braintrust/core@0.0.7(transitive)
- Removed@braintrust/core@0.0.6(transitive)
Updated@braintrust/core@^0.0.7