Skip to content

Commit

Permalink
Fix binding issue when tracing inside autoevals. (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
manugoyal authored Dec 18, 2023
1 parent 8f8da65 commit 29269ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ export function currentSpanTraced<R>(
if (globalThis.__inherited_braintrust_state) {
const currentSpan =
globalThis.__inherited_braintrust_state.currentSpan.getStore();
return currentSpan.traced(name, (span: any) => callback(span.log), args);
return currentSpan.traced(
name,
(span: any) => callback(span.log.bind(span)),
args
);
} else {
return callback(() => {});
}
Expand Down

0 comments on commit 29269ad

Please sign in to comment.