langsmith 0.1.63 → 0.1.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -8,4 +8,4 @@ Object.defineProperty(exports, "RunTree", { enumerable: true, get: function () {
8
8
  var fetch_js_1 = require("./singletons/fetch.cjs");
9
9
  Object.defineProperty(exports, "overrideFetchImplementation", { enumerable: true, get: function () { return fetch_js_1.overrideFetchImplementation; } });
10
10
  // Update using yarn bump-version
11
- exports.__version__ = "0.1.63";
11
+ exports.__version__ = "0.1.64";
package/dist/index.d.ts CHANGED
@@ -2,4 +2,4 @@ export { Client, type ClientConfig } from "./client.js";
2
2
  export type { Dataset, Example, TracerSession, Run, Feedback, RetrieverOutput, } from "./schemas.js";
3
3
  export { RunTree, type RunTreeConfig } from "./run_trees.js";
4
4
  export { overrideFetchImplementation } from "./singletons/fetch.js";
5
- export declare const __version__ = "0.1.63";
5
+ export declare const __version__ = "0.1.64";
package/dist/index.js CHANGED
@@ -2,4 +2,4 @@ export { Client } from "./client.js";
2
2
  export { RunTree } from "./run_trees.js";
3
3
  export { overrideFetchImplementation } from "./singletons/fetch.js";
4
4
  // Update using yarn bump-version
5
- export const __version__ = "0.1.63";
5
+ export const __version__ = "0.1.64";
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isTraceableFunction = exports.ROOT = exports.withRunTree = exports.getCurrentRunTree = exports.AsyncLocalStorageProviderSingleton = void 0;
4
+ const run_trees_js_1 = require("../run_trees.cjs");
4
5
  class MockAsyncLocalStorage {
5
6
  getStore() {
6
7
  return undefined;
@@ -33,7 +34,7 @@ exports.AsyncLocalStorageProviderSingleton = new AsyncLocalStorageProvider();
33
34
  */
34
35
  const getCurrentRunTree = () => {
35
36
  const runTree = exports.AsyncLocalStorageProviderSingleton.getInstance().getStore();
36
- if (runTree === undefined) {
37
+ if (!(0, run_trees_js_1.isRunTree)(runTree)) {
37
38
  throw new Error([
38
39
  "Could not get the current run tree.",
39
40
  "",
@@ -1,3 +1,4 @@
1
+ import { isRunTree } from "../run_trees.js";
1
2
  class MockAsyncLocalStorage {
2
3
  getStore() {
3
4
  return undefined;
@@ -30,7 +31,7 @@ export const AsyncLocalStorageProviderSingleton = new AsyncLocalStorageProvider(
30
31
  */
31
32
  export const getCurrentRunTree = () => {
32
33
  const runTree = AsyncLocalStorageProviderSingleton.getInstance().getStore();
33
- if (runTree === undefined) {
34
+ if (!isRunTree(runTree)) {
34
35
  throw new Error([
35
36
  "Could not get the current run tree.",
36
37
  "",
@@ -272,7 +272,7 @@ function traceable(wrappedFunc, config) {
272
272
  // Node.JS uses AsyncLocalStorage (ALS) and AsyncResource
273
273
  // to allow storing context
274
274
  const prevRunFromStore = asyncLocalStorage.getStore();
275
- if (prevRunFromStore) {
275
+ if ((0, run_trees_js_1.isRunTree)(prevRunFromStore)) {
276
276
  return [
277
277
  getTracingRunTree(prevRunFromStore.createChild(ensuredConfig), processedArgs, config?.getInvocationParams),
278
278
  processedArgs,
package/dist/traceable.js CHANGED
@@ -269,7 +269,7 @@ export function traceable(wrappedFunc, config) {
269
269
  // Node.JS uses AsyncLocalStorage (ALS) and AsyncResource
270
270
  // to allow storing context
271
271
  const prevRunFromStore = asyncLocalStorage.getStore();
272
- if (prevRunFromStore) {
272
+ if (isRunTree(prevRunFromStore)) {
273
273
  return [
274
274
  getTracingRunTree(prevRunFromStore.createChild(ensuredConfig), processedArgs, config?.getInvocationParams),
275
275
  processedArgs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.1.63",
3
+ "version": "0.1.64",
4
4
  "description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.",
5
5
  "packageManager": "yarn@1.22.19",
6
6
  "files": [