Skip to content

Commit

Permalink
Merge branch 'main' into nh/add-metadata-on-end
Browse files Browse the repository at this point in the history
  • Loading branch information
nhuang-lc authored Oct 11, 2024
2 parents e379108 + 21d7317 commit 0682ac0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "langsmith",
"version": "0.1.63",
"version": "0.1.64",
"description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.",
"packageManager": "[email protected]",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export { RunTree, type RunTreeConfig } from "./run_trees.js";
export { overrideFetchImplementation } from "./singletons/fetch.js";

// Update using yarn bump-version
export const __version__ = "0.1.63";
export const __version__ = "0.1.64";
4 changes: 2 additions & 2 deletions js/src/singletons/traceable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RunTree } from "../run_trees.js";
import { isRunTree, RunTree } from "../run_trees.js";
import { TraceableFunction } from "./types.js";

interface AsyncLocalStorageInterface {
Expand Down Expand Up @@ -47,7 +47,7 @@ export const AsyncLocalStorageProviderSingleton =
*/
export const getCurrentRunTree = () => {
const runTree = AsyncLocalStorageProviderSingleton.getInstance().getStore();
if (runTree === undefined) {
if (!isRunTree(runTree)) {
throw new Error(
[
"Could not get the current run tree.",
Expand Down
2 changes: 1 addition & 1 deletion js/src/traceable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export function traceable<Func extends (...args: any[]) => any>(
// Node.JS uses AsyncLocalStorage (ALS) and AsyncResource
// to allow storing context
const prevRunFromStore = asyncLocalStorage.getStore();
if (prevRunFromStore) {
if (isRunTree(prevRunFromStore)) {
return [
getTracingRunTree(
prevRunFromStore.createChild(ensuredConfig),
Expand Down

0 comments on commit 0682ac0

Please sign in to comment.