langsmith 0.1.55-rc.1 → 0.1.56-hotfix

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
@@ -2390,11 +2390,9 @@ class Client {
2390
2390
  };
2391
2391
  }
2392
2392
  /**
2393
- *
2394
2393
  * This method should not be used directly, use `import { pull } from "langchain/hub"` instead.
2395
2394
  * Using this method directly returns the JSON string of the prompt rather than a LangChain object.
2396
2395
  * @private
2397
- *
2398
2396
  */
2399
2397
  async _pullPrompt(promptIdentifier, options) {
2400
2398
  const promptObject = await this.pullPromptCommit(promptIdentifier, {
package/dist/client.d.ts CHANGED
@@ -638,11 +638,9 @@ export declare class Client {
638
638
  includeModel?: boolean;
639
639
  }): Promise<PromptCommit>;
640
640
  /**
641
- *
642
641
  * This method should not be used directly, use `import { pull } from "langchain/hub"` instead.
643
642
  * Using this method directly returns the JSON string of the prompt rather than a LangChain object.
644
643
  * @private
645
- *
646
644
  */
647
645
  _pullPrompt(promptIdentifier: string, options?: {
648
646
  includeModel?: boolean;
package/dist/client.js CHANGED
@@ -2363,11 +2363,9 @@ export class Client {
2363
2363
  };
2364
2364
  }
2365
2365
  /**
2366
- *
2367
2366
  * This method should not be used directly, use `import { pull } from "langchain/hub"` instead.
2368
2367
  * Using this method directly returns the JSON string of the prompt rather than a LangChain object.
2369
2368
  * @private
2370
- *
2371
2369
  */
2372
2370
  async _pullPrompt(promptIdentifier, options) {
2373
2371
  const promptObject = await this.pullPromptCommit(promptIdentifier, {
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports._ExperimentManager = exports.evaluate = void 0;
4
4
  const index_js_1 = require("../index.cjs");
5
- const langchain_js_1 = require("../langchain.cjs");
6
5
  const traceable_js_1 = require("../traceable.cjs");
7
6
  const _git_js_1 = require("../utils/_git.cjs");
8
7
  const _uuid_js_1 = require("../utils/_uuid.cjs");
@@ -680,8 +679,22 @@ async function _forward(fn, example, experimentName, metadata, client) {
680
679
  };
681
680
  const wrappedFn = "invoke" in fn
682
681
  ? (0, traceable_js_1.traceable)(async (inputs) => {
683
- const callbacks = await (0, langchain_js_1.getLangchainCallbacks)();
684
- return fn.invoke(inputs, { callbacks });
682
+ let langChainCallbacks;
683
+ try {
684
+ // TODO: Deprecate this and rely on interop on 0.2 minor bump.
685
+ const { getLangchainCallbacks } = await import("../langchain.js");
686
+ langChainCallbacks = await getLangchainCallbacks();
687
+ }
688
+ catch {
689
+ // no-op
690
+ }
691
+ // Issue with retrieving LangChain callbacks, rely on interop
692
+ if (langChainCallbacks === undefined) {
693
+ return await fn.invoke(inputs);
694
+ }
695
+ else {
696
+ return await fn.invoke(inputs, { callbacks: langChainCallbacks });
697
+ }
685
698
  }, options)
686
699
  : (0, traceable_js_1.traceable)(fn, options);
687
700
  try {
@@ -1,5 +1,4 @@
1
1
  import { Client } from "../index.js";
2
- import { getLangchainCallbacks } from "../langchain.js";
3
2
  import { traceable } from "../traceable.js";
4
3
  import { getDefaultRevisionId, getGitInfo } from "../utils/_git.js";
5
4
  import { assertUuid } from "../utils/_uuid.js";
@@ -675,8 +674,22 @@ async function _forward(fn, example, experimentName, metadata, client) {
675
674
  };
676
675
  const wrappedFn = "invoke" in fn
677
676
  ? traceable(async (inputs) => {
678
- const callbacks = await getLangchainCallbacks();
679
- return fn.invoke(inputs, { callbacks });
677
+ let langChainCallbacks;
678
+ try {
679
+ // TODO: Deprecate this and rely on interop on 0.2 minor bump.
680
+ const { getLangchainCallbacks } = await import("../langchain.js");
681
+ langChainCallbacks = await getLangchainCallbacks();
682
+ }
683
+ catch {
684
+ // no-op
685
+ }
686
+ // Issue with retrieving LangChain callbacks, rely on interop
687
+ if (langChainCallbacks === undefined) {
688
+ return await fn.invoke(inputs);
689
+ }
690
+ else {
691
+ return await fn.invoke(inputs, { callbacks: langChainCallbacks });
692
+ }
680
693
  }, options)
681
694
  : traceable(fn, options);
682
695
  try {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLangchainStringEvaluator = void 0;
4
+ // eslint-disable-next-line import/no-extraneous-dependencies
4
5
  const evaluation_1 = require("langchain/evaluation");
5
6
  const langchain_js_1 = require("../langchain.cjs");
6
7
  function isStringifiable(value) {
@@ -23,6 +24,8 @@ function getPrimitiveValue(value) {
23
24
  return undefined;
24
25
  }
25
26
  /**
27
+ * @deprecated Use `evaluate` instead.
28
+ *
26
29
  * This utility function loads a LangChain string evaluator and returns a function
27
30
  * which can be used by newer `evaluate` function.
28
31
  *
@@ -1,6 +1,8 @@
1
- import type { Run, Example } from "../schemas.js";
2
1
  import { type LoadEvaluatorOptions } from "langchain/evaluation";
2
+ import type { Run, Example } from "../schemas.js";
3
3
  /**
4
+ * @deprecated Use `evaluate` instead.
5
+ *
4
6
  * This utility function loads a LangChain string evaluator and returns a function
5
7
  * which can be used by newer `evaluate` function.
6
8
  *
@@ -1,3 +1,4 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies
1
2
  import { loadEvaluator } from "langchain/evaluation";
2
3
  import { getLangchainCallbacks } from "../langchain.js";
3
4
  function isStringifiable(value) {
@@ -20,6 +21,8 @@ function getPrimitiveValue(value) {
20
21
  return undefined;
21
22
  }
22
23
  /**
24
+ * @deprecated Use `evaluate` instead.
25
+ *
23
26
  * This utility function loads a LangChain string evaluator and returns a function
24
27
  * which can be used by newer `evaluate` function.
25
28
  *
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.55-rc.1";
11
+ exports.__version__ = "0.1.56-hotfix";
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.55-rc.1";
5
+ export declare const __version__ = "0.1.56-hotfix";
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.55-rc.1";
5
+ export const __version__ = "0.1.56-hotfix";
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RunnableTraceable = exports.getLangchainCallbacks = void 0;
4
+ // These `@langchain/core` imports are intentionally not peer dependencies
5
+ // to avoid package manager issues around circular dependencies.
6
+ // eslint-disable-next-line import/no-extraneous-dependencies
4
7
  const manager_1 = require("@langchain/core/callbacks/manager");
8
+ // eslint-disable-next-line import/no-extraneous-dependencies
5
9
  const tracer_langchain_1 = require("@langchain/core/tracers/tracer_langchain");
10
+ // eslint-disable-next-line import/no-extraneous-dependencies
6
11
  const runnables_1 = require("@langchain/core/runnables");
7
12
  const traceable_js_1 = require("./traceable.cjs");
8
13
  const asserts_js_1 = require("./utils/asserts.cjs");
package/dist/langchain.js CHANGED
@@ -1,5 +1,10 @@
1
+ // These `@langchain/core` imports are intentionally not peer dependencies
2
+ // to avoid package manager issues around circular dependencies.
3
+ // eslint-disable-next-line import/no-extraneous-dependencies
1
4
  import { CallbackManager } from "@langchain/core/callbacks/manager";
5
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
6
  import { LangChainTracer } from "@langchain/core/tracers/tracer_langchain";
7
+ // eslint-disable-next-line import/no-extraneous-dependencies
3
8
  import { Runnable, patchConfig, getCallbackManagerForConfig, } from "@langchain/core/runnables";
4
9
  import { getCurrentRunTree, isTraceableFunction, } from "./traceable.js";
5
10
  import { isAsyncIterable, isIteratorLike } from "./utils/asserts.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.1.55-rc.1",
3
+ "version": "0.1.56-hotfix",
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": [
@@ -109,9 +109,9 @@
109
109
  "@babel/preset-env": "^7.22.4",
110
110
  "@faker-js/faker": "^8.4.1",
111
111
  "@jest/globals": "^29.5.0",
112
- "@langchain/core": "^0.2.17",
113
- "@langchain/langgraph": "^0.0.29",
114
- "@langchain/openai": "^0.2.5",
112
+ "@langchain/core": "^0.3.1",
113
+ "@langchain/langgraph": "^0.2.3",
114
+ "@langchain/openai": "^0.3.0",
115
115
  "@tsconfig/recommended": "^1.0.2",
116
116
  "@types/jest": "^29.5.1",
117
117
  "@typescript-eslint/eslint-plugin": "^5.59.8",
@@ -126,7 +126,7 @@
126
126
  "eslint-plugin-no-instanceof": "^1.0.1",
127
127
  "eslint-plugin-prettier": "^4.2.1",
128
128
  "jest": "^29.5.0",
129
- "langchain": "^0.2.10",
129
+ "langchain": "^0.3.2",
130
130
  "openai": "^4.38.5",
131
131
  "prettier": "^2.8.8",
132
132
  "ts-jest": "^29.1.0",
@@ -135,19 +135,11 @@
135
135
  "zod": "^3.23.8"
136
136
  },
137
137
  "peerDependencies": {
138
- "@langchain/core": "*",
139
- "langchain": "*",
140
138
  "openai": "*"
141
139
  },
142
140
  "peerDependenciesMeta": {
143
141
  "openai": {
144
142
  "optional": true
145
- },
146
- "langchain": {
147
- "optional": true
148
- },
149
- "@langchain/core": {
150
- "optional": true
151
143
  }
152
144
  },
153
145
  "lint-staged": {