langsmith 0.3.26 → 0.3.27

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
@@ -662,7 +662,7 @@ class Client {
662
662
  return itemPromise;
663
663
  }
664
664
  async _getServerInfo() {
665
- const response = await (0, fetch_js_1._getFetchImplementation)(this.debug)(`${this.apiUrl}/info`, {
665
+ const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(this.debug), `${this.apiUrl}/info`, {
666
666
  method: "GET",
667
667
  headers: { Accept: "application/json" },
668
668
  signal: AbortSignal.timeout(SERVER_INFO_REQUEST_TIMEOUT),
@@ -685,7 +685,7 @@ class Client {
685
685
  this._serverInfo = await this._getServerInfo();
686
686
  }
687
687
  catch (e) {
688
- console.warn(`[WARNING]: LangSmith failed to fetch info on supported operations. Falling back to batch operations and default limits.`);
688
+ console.warn(`[WARNING]: LangSmith failed to fetch info on supported operations with status code ${e.status}. Falling back to batch operations and default limits.`);
689
689
  }
690
690
  }
691
691
  return this._serverInfo ?? {};
package/dist/client.js CHANGED
@@ -624,7 +624,7 @@ export class Client {
624
624
  return itemPromise;
625
625
  }
626
626
  async _getServerInfo() {
627
- const response = await _getFetchImplementation(this.debug)(`${this.apiUrl}/info`, {
627
+ const response = await this.caller.call(_getFetchImplementation(this.debug), `${this.apiUrl}/info`, {
628
628
  method: "GET",
629
629
  headers: { Accept: "application/json" },
630
630
  signal: AbortSignal.timeout(SERVER_INFO_REQUEST_TIMEOUT),
@@ -647,7 +647,7 @@ export class Client {
647
647
  this._serverInfo = await this._getServerInfo();
648
648
  }
649
649
  catch (e) {
650
- console.warn(`[WARNING]: LangSmith failed to fetch info on supported operations. Falling back to batch operations and default limits.`);
650
+ console.warn(`[WARNING]: LangSmith failed to fetch info on supported operations with status code ${e.status}. Falling back to batch operations and default limits.`);
651
651
  }
652
652
  }
653
653
  return this._serverInfo ?? {};
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.26";
11
+ exports.__version__ = "0.3.27";
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.26";
5
+ export declare const __version__ = "0.3.27";
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.26";
5
+ export const __version__ = "0.3.27";
@@ -58,7 +58,14 @@ function printErrorStackTrace(e) {
58
58
  class LangSmithConflictError extends Error {
59
59
  constructor(message) {
60
60
  super(message);
61
+ Object.defineProperty(this, "status", {
62
+ enumerable: true,
63
+ configurable: true,
64
+ writable: true,
65
+ value: void 0
66
+ });
61
67
  this.name = "LangSmithConflictError";
68
+ this.status = 409;
62
69
  }
63
70
  }
64
71
  exports.LangSmithConflictError = LangSmithConflictError;
@@ -85,5 +92,7 @@ async function raiseForStatus(response, context, consume) {
85
92
  if (response.status === 409) {
86
93
  throw new LangSmithConflictError(fullMessage);
87
94
  }
88
- throw new Error(fullMessage);
95
+ const err = new Error(fullMessage);
96
+ err.status = response.status;
97
+ throw err;
89
98
  }
@@ -31,6 +31,7 @@ export declare function printErrorStackTrace(e: unknown): void;
31
31
  * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409
32
32
  */
33
33
  export declare class LangSmithConflictError extends Error {
34
+ status: number;
34
35
  constructor(message: string);
35
36
  }
36
37
  /**
@@ -53,7 +53,14 @@ export function printErrorStackTrace(e) {
53
53
  export class LangSmithConflictError extends Error {
54
54
  constructor(message) {
55
55
  super(message);
56
+ Object.defineProperty(this, "status", {
57
+ enumerable: true,
58
+ configurable: true,
59
+ writable: true,
60
+ value: void 0
61
+ });
56
62
  this.name = "LangSmithConflictError";
63
+ this.status = 409;
57
64
  }
58
65
  }
59
66
  /**
@@ -79,5 +86,7 @@ export async function raiseForStatus(response, context, consume) {
79
86
  if (response.status === 409) {
80
87
  throw new LangSmithConflictError(fullMessage);
81
88
  }
82
- throw new Error(fullMessage);
89
+ const err = new Error(fullMessage);
90
+ err.status = response.status;
91
+ throw err;
83
92
  }
@@ -166,7 +166,7 @@ function processChatCompletion(outputs) {
166
166
  * const patchedStream = await patchedClient.chat.completions.create(
167
167
  * {
168
168
  * messages: [{ role: "user", content: `Say 'foo'` }],
169
- * model: "gpt-3.5-turbo",
169
+ * model: "gpt-4.1-mini",
170
170
  * stream: true,
171
171
  * },
172
172
  * {
@@ -61,7 +61,7 @@ type PatchedOpenAIClient<T extends OpenAIType> = T & {
61
61
  * const patchedStream = await patchedClient.chat.completions.create(
62
62
  * {
63
63
  * messages: [{ role: "user", content: `Say 'foo'` }],
64
- * model: "gpt-3.5-turbo",
64
+ * model: "gpt-4.1-mini",
65
65
  * stream: true,
66
66
  * },
67
67
  * {
@@ -163,7 +163,7 @@ function processChatCompletion(outputs) {
163
163
  * const patchedStream = await patchedClient.chat.completions.create(
164
164
  * {
165
165
  * messages: [{ role: "user", content: `Say 'foo'` }],
166
- * model: "gpt-3.5-turbo",
166
+ * model: "gpt-4.1-mini",
167
167
  * stream: true,
168
168
  * },
169
169
  * {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.3.26",
3
+ "version": "0.3.27",
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": [