langsmith 0.3.15 → 0.3.16

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/client.cjs CHANGED
@@ -2928,7 +2928,7 @@ class Client {
2928
2928
  }
2929
2929
  async _updateExamplesMultipart(datasetId, updates = []) {
2930
2930
  if (!(await this._getMultiPartSupport())) {
2931
- throw new Error("Your LangSmith version does not allow using the multipart examples endpoint, please update to the latest version.");
2931
+ throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");
2932
2932
  }
2933
2933
  const formData = new FormData();
2934
2934
  for (const example of updates) {
@@ -3006,7 +3006,7 @@ class Client {
3006
3006
  }
3007
3007
  async _uploadExamplesMultipart(datasetId, uploads = []) {
3008
3008
  if (!(await this._getMultiPartSupport())) {
3009
- throw new Error("Your LangSmith version does not allow using the multipart examples endpoint, please update to the latest version.");
3009
+ throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");
3010
3010
  }
3011
3011
  const formData = new FormData();
3012
3012
  for (const example of uploads) {
@@ -3070,6 +3070,7 @@ class Client {
3070
3070
  headers: this.headers,
3071
3071
  body: formData,
3072
3072
  });
3073
+ await (0, error_js_1.raiseForStatus)(response, "upload examples");
3073
3074
  const result = await response.json();
3074
3075
  return result;
3075
3076
  }
package/dist/client.js CHANGED
@@ -2890,7 +2890,7 @@ export class Client {
2890
2890
  }
2891
2891
  async _updateExamplesMultipart(datasetId, updates = []) {
2892
2892
  if (!(await this._getMultiPartSupport())) {
2893
- throw new Error("Your LangSmith version does not allow using the multipart examples endpoint, please update to the latest version.");
2893
+ throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");
2894
2894
  }
2895
2895
  const formData = new FormData();
2896
2896
  for (const example of updates) {
@@ -2968,7 +2968,7 @@ export class Client {
2968
2968
  }
2969
2969
  async _uploadExamplesMultipart(datasetId, uploads = []) {
2970
2970
  if (!(await this._getMultiPartSupport())) {
2971
- throw new Error("Your LangSmith version does not allow using the multipart examples endpoint, please update to the latest version.");
2971
+ throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");
2972
2972
  }
2973
2973
  const formData = new FormData();
2974
2974
  for (const example of uploads) {
@@ -3032,6 +3032,7 @@ export class Client {
3032
3032
  headers: this.headers,
3033
3033
  body: formData,
3034
3034
  });
3035
+ await raiseForStatus(response, "upload examples");
3035
3036
  const result = await response.json();
3036
3037
  return result;
3037
3038
  }
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.3.15";
11
+ exports.__version__ = "0.3.16";
package/dist/index.d.ts CHANGED
@@ -2,4 +2,4 @@ export { Client, type ClientConfig, type LangSmithTracingClientInterface, } from
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.3.15";
5
+ export declare const __version__ = "0.3.16";
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.3.15";
5
+ export const __version__ = "0.3.16";
@@ -434,6 +434,7 @@ class RunTree {
434
434
  trace_id: this.trace_id,
435
435
  tags: this.tags,
436
436
  attachments: this.attachments,
437
+ session_name: this.project_name,
437
438
  };
438
439
  await this.client.updateRun(this.id, runUpdate);
439
440
  }
package/dist/run_trees.js CHANGED
@@ -395,6 +395,7 @@ export class RunTree {
395
395
  trace_id: this.trace_id,
396
396
  tags: this.tags,
397
397
  attachments: this.attachments,
398
+ session_name: this.project_name,
398
399
  };
399
400
  await this.client.updateRun(this.id, runUpdate);
400
401
  }
package/dist/schemas.d.ts CHANGED
@@ -162,6 +162,7 @@ export interface RunUpdate {
162
162
  reference_example_id?: string;
163
163
  events?: KVMap[];
164
164
  session_id?: string;
165
+ session_name?: string;
165
166
  /** Unique ID assigned to every run within this nested trace. **/
166
167
  trace_id?: string;
167
168
  /**
@@ -230,6 +230,9 @@ function generateWrapperFromJestlikeMethods(methods, testRunnerName) {
230
230
  return storageValue;
231
231
  }
232
232
  function wrapDescribeMethod(method) {
233
+ if ((0, env_js_1.isJsDom)()) {
234
+ console.error(`[LANGSMITH]: You seem to be using a jsdom environment. This is not supported and you may experience unexpected behavior. Please set the "environment" or "testEnvironment" field in your test config file to "node".`);
235
+ }
233
236
  return function (testSuiteName, fn, experimentConfig) {
234
237
  const client = experimentConfig?.client ?? globals_js_1.DEFAULT_TEST_CLIENT;
235
238
  const suiteName = experimentConfig?.testSuiteName ?? testSuiteName;
@@ -11,7 +11,7 @@ import { randomName } from "../../evaluation/_random_name.js";
11
11
  import { toBeRelativeCloseTo, toBeAbsoluteCloseTo, toBeSemanticCloseTo, } from "./matchers.js";
12
12
  import { evaluatorLogFeedbackPromises, testWrapperAsyncLocalStorageInstance, _logTestFeedback, syncExamplePromises, trackingEnabled, DEFAULT_TEST_CLIENT, } from "./globals.js";
13
13
  import { wrapExpect } from "./vendor/chain.js";
14
- import { getEnvironmentVariable } from "../env.js";
14
+ import { getEnvironmentVariable, isJsDom } from "../env.js";
15
15
  import { STRIP_ANSI_REGEX, TEST_ID_DELIMITER, DEFAULT_TEST_TIMEOUT, UUID5_NAMESPACE, } from "./constants.js";
16
16
  export function logFeedback(feedback, config) {
17
17
  const context = testWrapperAsyncLocalStorageInstance.getStore();
@@ -183,6 +183,9 @@ export function generateWrapperFromJestlikeMethods(methods, testRunnerName) {
183
183
  return storageValue;
184
184
  }
185
185
  function wrapDescribeMethod(method) {
186
+ if (isJsDom()) {
187
+ console.error(`[LANGSMITH]: You seem to be using a jsdom environment. This is not supported and you may experience unexpected behavior. Please set the "environment" or "testEnvironment" field in your test config file to "node".`);
188
+ }
186
189
  return function (testSuiteName, fn, experimentConfig) {
187
190
  const client = experimentConfig?.client ?? DEFAULT_TEST_CLIENT;
188
191
  const suiteName = experimentConfig?.testSuiteName ?? testSuiteName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
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": [