langsmith 0.2.9 → 0.2.11

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
@@ -172,7 +172,7 @@ class AutoBatchQueue {
172
172
  exports.AutoBatchQueue = AutoBatchQueue;
173
173
  // 20 MB
174
174
  exports.DEFAULT_BATCH_SIZE_LIMIT_BYTES = 20_971_520;
175
- const SERVER_INFO_REQUEST_TIMEOUT = 1000;
175
+ const SERVER_INFO_REQUEST_TIMEOUT = 2500;
176
176
  class Client {
177
177
  constructor(config = {}) {
178
178
  Object.defineProperty(this, "apiKey", {
@@ -2716,19 +2716,7 @@ class Client {
2716
2716
  }
2717
2717
  async pullPromptCommit(promptIdentifier, options) {
2718
2718
  const [owner, promptName, commitHash] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
2719
- const serverInfo = await this._getServerInfo();
2720
- const useOptimization = (0, prompts_js_1.isVersionGreaterOrEqual)(serverInfo.version, "0.5.23");
2721
- let passedCommitHash = commitHash;
2722
- if (!useOptimization && commitHash === "latest") {
2723
- const latestCommitHash = await this._getLatestCommitHash(`${owner}/${promptName}`);
2724
- if (!latestCommitHash) {
2725
- throw new Error("No commits found");
2726
- }
2727
- else {
2728
- passedCommitHash = latestCommitHash;
2729
- }
2730
- }
2731
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/commits/${owner}/${promptName}/${passedCommitHash}${options?.includeModel ? "?include_model=true" : ""}`, {
2719
+ const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/commits/${owner}/${promptName}/${commitHash}${options?.includeModel ? "?include_model=true" : ""}`, {
2732
2720
  method: "GET",
2733
2721
  headers: this.headers,
2734
2722
  signal: AbortSignal.timeout(this.timeout_ms),
package/dist/client.js CHANGED
@@ -5,7 +5,7 @@ import { getEnvironmentVariable, getLangChainEnvVarsMetadata, getLangSmithEnviro
5
5
  import { __version__ } from "./index.js";
6
6
  import { assertUuid } from "./utils/_uuid.js";
7
7
  import { warnOnce } from "./utils/warn.js";
8
- import { isVersionGreaterOrEqual, parsePromptIdentifier, } from "./utils/prompts.js";
8
+ import { parsePromptIdentifier } from "./utils/prompts.js";
9
9
  import { raiseForStatus } from "./utils/error.js";
10
10
  import { _getFetchImplementation } from "./singletons/fetch.js";
11
11
  import { stringify as stringifyForTracing } from "./utils/fast-safe-stringify/index.js";
@@ -144,7 +144,7 @@ export class AutoBatchQueue {
144
144
  }
145
145
  // 20 MB
146
146
  export const DEFAULT_BATCH_SIZE_LIMIT_BYTES = 20_971_520;
147
- const SERVER_INFO_REQUEST_TIMEOUT = 1000;
147
+ const SERVER_INFO_REQUEST_TIMEOUT = 2500;
148
148
  export class Client {
149
149
  constructor(config = {}) {
150
150
  Object.defineProperty(this, "apiKey", {
@@ -2688,19 +2688,7 @@ export class Client {
2688
2688
  }
2689
2689
  async pullPromptCommit(promptIdentifier, options) {
2690
2690
  const [owner, promptName, commitHash] = parsePromptIdentifier(promptIdentifier);
2691
- const serverInfo = await this._getServerInfo();
2692
- const useOptimization = isVersionGreaterOrEqual(serverInfo.version, "0.5.23");
2693
- let passedCommitHash = commitHash;
2694
- if (!useOptimization && commitHash === "latest") {
2695
- const latestCommitHash = await this._getLatestCommitHash(`${owner}/${promptName}`);
2696
- if (!latestCommitHash) {
2697
- throw new Error("No commits found");
2698
- }
2699
- else {
2700
- passedCommitHash = latestCommitHash;
2701
- }
2702
- }
2703
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/commits/${owner}/${promptName}/${passedCommitHash}${options?.includeModel ? "?include_model=true" : ""}`, {
2691
+ const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/commits/${owner}/${promptName}/${commitHash}${options?.includeModel ? "?include_model=true" : ""}`, {
2704
2692
  method: "GET",
2705
2693
  headers: this.headers,
2706
2694
  signal: AbortSignal.timeout(this.timeout_ms),
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.2.9";
11
+ exports.__version__ = "0.2.11";
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.2.9";
5
+ export declare const __version__ = "0.2.11";
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.2.9";
5
+ export const __version__ = "0.2.11";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
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": [