@langchain/core 0.3.59-rc.1 → 0.3.59-rc.2

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.
@@ -65,7 +65,7 @@ exports.consumeCallback = consumeCallback;
65
65
  */
66
66
  async function awaitAllCallbacks() {
67
67
  const defaultClient = (0, tracer_js_1.getDefaultLangChainClientSingleton)();
68
- await Promise.all([
68
+ await Promise.allSettled([
69
69
  typeof queue !== "undefined" ? queue.onIdle() : Promise.resolve(),
70
70
  defaultClient.awaitPendingTraceBatches(),
71
71
  ]);
@@ -57,7 +57,7 @@ export async function consumeCallback(promiseFn, wait) {
57
57
  */
58
58
  export async function awaitAllCallbacks() {
59
59
  const defaultClient = getDefaultLangChainClientSingleton();
60
- await Promise.all([
60
+ await Promise.allSettled([
61
61
  typeof queue !== "undefined" ? queue.onIdle() : Promise.resolve(),
62
62
  defaultClient.awaitPendingTraceBatches(),
63
63
  ]);
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LangChainTracer = void 0;
4
+ const langsmith_1 = require("langsmith");
4
5
  const run_trees_1 = require("langsmith/run_trees");
5
6
  const traceable_1 = require("langsmith/singletons/traceable");
6
- const env_js_1 = require("../utils/env.cjs");
7
7
  const base_js_1 = require("./base.cjs");
8
8
  const tracer_js_1 = require("../singletons/tracer.cjs");
9
9
  class LangChainTracer extends base_js_1.BaseTracer {
@@ -46,10 +46,7 @@ class LangChainTracer extends base_js_1.BaseTracer {
46
46
  value: true
47
47
  });
48
48
  const { exampleId, projectName, client, replicas } = fields;
49
- this.projectName =
50
- projectName ??
51
- (0, env_js_1.getEnvironmentVariable)("LANGCHAIN_PROJECT") ??
52
- (0, env_js_1.getEnvironmentVariable)("LANGCHAIN_SESSION");
49
+ this.projectName = projectName ?? (0, langsmith_1.getDefaultProjectName)();
53
50
  this.replicas = replicas;
54
51
  this.exampleId = exampleId;
55
52
  this.client = client ?? (0, tracer_js_1.getDefaultLangChainClientSingleton)();
@@ -1,4 +1,4 @@
1
- import type { LangSmithTracingClientInterface } from "langsmith";
1
+ import { type LangSmithTracingClientInterface } from "langsmith";
2
2
  import { RunTree } from "langsmith/run_trees";
3
3
  import { BaseRun, RunCreate, RunUpdate as BaseRunUpdate, KVMap } from "langsmith/schemas";
4
4
  import { BaseTracer } from "./base.js";
@@ -1,6 +1,6 @@
1
+ import { getDefaultProjectName, } from "langsmith";
1
2
  import { RunTree } from "langsmith/run_trees";
2
3
  import { getCurrentRunTree } from "langsmith/singletons/traceable";
3
- import { getEnvironmentVariable } from "../utils/env.js";
4
4
  import { BaseTracer } from "./base.js";
5
5
  import { getDefaultLangChainClientSingleton } from "../singletons/tracer.js";
6
6
  export class LangChainTracer extends BaseTracer {
@@ -43,10 +43,7 @@ export class LangChainTracer extends BaseTracer {
43
43
  value: true
44
44
  });
45
45
  const { exampleId, projectName, client, replicas } = fields;
46
- this.projectName =
47
- projectName ??
48
- getEnvironmentVariable("LANGCHAIN_PROJECT") ??
49
- getEnvironmentVariable("LANGCHAIN_SESSION");
46
+ this.projectName = projectName ?? getDefaultProjectName();
50
47
  this.replicas = replicas;
51
48
  this.exampleId = exampleId;
52
49
  this.client = client ?? getDefaultLangChainClientSingleton();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/core",
3
- "version": "0.3.59-rc.1",
3
+ "version": "0.3.59-rc.2",
4
4
  "description": "Core LangChain.js abstractions and schemas",
5
5
  "type": "module",
6
6
  "engines": {
@@ -38,7 +38,7 @@
38
38
  "camelcase": "6",
39
39
  "decamelize": "1.2.0",
40
40
  "js-tiktoken": "^1.0.12",
41
- "langsmith": "^0.3.32",
41
+ "langsmith": "^0.3.33",
42
42
  "mustache": "^4.2.0",
43
43
  "p-queue": "^6.6.2",
44
44
  "p-retry": "4",