@langchain/core 0.2.14 → 0.2.15

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 🦜🍎️ @langchain/core
2
2
 
3
- [![CI](https://github.com/langchain-ai/langchainjs/actions/workflows/ci.yml/badge.svg)](https://github.com/langchain-ai/langchainjs/actions/workflows/ci.yml) ![npm](https://img.shields.io/npm/dm/@langchain/core) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/langchainai.svg?style=social&label=Follow%20%40LangChainAI)](https://twitter.com/langchainai) [![](https://dcbadge.vercel.app/api/server/6adMQxSpJS?compact=true&style=flat)](https://discord.gg/6adMQxSpJS)
3
+ [![CI](https://github.com/langchain-ai/langchainjs/actions/workflows/ci.yml/badge.svg)](https://github.com/langchain-ai/langchainjs/actions/workflows/ci.yml) ![npm](https://img.shields.io/npm/dm/@langchain/core) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/langchainai.svg?style=social&label=Follow%20%40LangChainAI)](https://twitter.com/langchainai)
4
4
 
5
5
  `@langchain/core` contains the core abstractions and schemas of LangChain.js, including base classes for language models,
6
6
  chat models, vectorstores, retrievers, and runnables.
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.traceAsGroup = exports.TraceGroup = exports.ensureHandler = exports.CallbackManager = exports.CallbackManagerForToolRun = exports.CallbackManagerForChainRun = exports.CallbackManagerForLLMRun = exports.CallbackManagerForRetrieverRun = exports.BaseCallbackManager = exports.parseCallbackConfigArg = void 0;
3
+ exports.traceAsGroup = exports.TraceGroup = exports.ensureHandler = exports.CallbackManager = exports.CallbackManagerForToolRun = exports.CallbackManagerForChainRun = exports.CallbackManagerForLLMRun = exports.CallbackManagerForRetrieverRun = exports.BaseRunManager = exports.BaseCallbackManager = exports.parseCallbackConfigArg = void 0;
4
4
  const uuid_1 = require("uuid");
5
5
  const base_js_1 = require("./base.cjs");
6
6
  const console_js_1 = require("../tracers/console.cjs");
7
- const initialize_js_1 = require("../tracers/initialize.cjs");
8
7
  const utils_js_1 = require("../messages/utils.cjs");
9
8
  const env_js_1 = require("../utils/env.cjs");
10
9
  const tracer_langchain_js_1 = require("../tracers/tracer_langchain.cjs");
11
10
  const promises_js_1 = require("./promises.cjs");
11
+ const callbacks_js_1 = require("../utils/callbacks.cjs");
12
12
  if (
13
13
  /* #__PURE__ */ (0, env_js_1.getEnvironmentVariable)("LANGCHAIN_TRACING_V2") === "true" &&
14
14
  /* #__PURE__ */ (0, env_js_1.getEnvironmentVariable)("LANGCHAIN_CALLBACKS_BACKGROUND") !==
@@ -94,6 +94,9 @@ class BaseRunManager {
94
94
  value: _parentRunId
95
95
  });
96
96
  }
97
+ get parentRunId() {
98
+ return this._parentRunId;
99
+ }
97
100
  async handleText(text) {
98
101
  await Promise.all(this.handlers.map((handler) => (0, promises_js_1.consumeCallback)(async () => {
99
102
  try {
@@ -108,6 +111,7 @@ class BaseRunManager {
108
111
  }, handler.awaitHandlers)));
109
112
  }
110
113
  }
114
+ exports.BaseRunManager = BaseRunManager;
111
115
  /**
112
116
  * Manages callbacks for retriever runs.
113
117
  */
@@ -586,6 +590,10 @@ class CallbackManager extends BaseCallbackManager {
586
590
  return manager;
587
591
  }
588
592
  static async configure(inheritableHandlers, localHandlers, inheritableTags, localTags, inheritableMetadata, localMetadata, options) {
593
+ return this._configureSync(inheritableHandlers, localHandlers, inheritableTags, localTags, inheritableMetadata, localMetadata, options);
594
+ }
595
+ // TODO: Deprecate async method in favor of this one.
596
+ static _configureSync(inheritableHandlers, localHandlers, inheritableTags, localTags, inheritableMetadata, localMetadata, options) {
589
597
  let callbackManager;
590
598
  if (inheritableHandlers || localHandlers) {
591
599
  if (Array.isArray(inheritableHandlers) || !inheritableHandlers) {
@@ -601,8 +609,7 @@ class CallbackManager extends BaseCallbackManager {
601
609
  }
602
610
  const verboseEnabled = (0, env_js_1.getEnvironmentVariable)("LANGCHAIN_VERBOSE") === "true" ||
603
611
  options?.verbose;
604
- const tracingV2Enabled = (0, env_js_1.getEnvironmentVariable)("LANGCHAIN_TRACING_V2") === "true" ||
605
- (0, env_js_1.getEnvironmentVariable)("LANGSMITH_TRACING") === "true";
612
+ const tracingV2Enabled = (0, callbacks_js_1.isTracingEnabled)();
606
613
  const tracingEnabled = tracingV2Enabled ||
607
614
  ((0, env_js_1.getEnvironmentVariable)("LANGCHAIN_TRACING") ?? false);
608
615
  if (verboseEnabled || tracingEnabled) {
@@ -617,7 +624,7 @@ class CallbackManager extends BaseCallbackManager {
617
624
  if (tracingEnabled &&
618
625
  !callbackManager.handlers.some((handler) => handler.name === "langchain_tracer")) {
619
626
  if (tracingV2Enabled) {
620
- const tracerV2 = await (0, initialize_js_1.getTracingV2CallbackHandler)();
627
+ const tracerV2 = new tracer_langchain_js_1.LangChainTracer();
621
628
  callbackManager.addHandler(tracerV2, true);
622
629
  // handoff between langchain and langsmith/traceable
623
630
  // override the parent run ID
@@ -53,7 +53,7 @@ export declare abstract class BaseCallbackManager {
53
53
  /**
54
54
  * Base class for run manager in LangChain.
55
55
  */
56
- declare class BaseRunManager {
56
+ export declare class BaseRunManager {
57
57
  readonly runId: string;
58
58
  readonly handlers: BaseCallbackHandler[];
59
59
  protected readonly inheritableHandlers: BaseCallbackHandler[];
@@ -63,6 +63,7 @@ declare class BaseRunManager {
63
63
  protected readonly inheritableMetadata: Record<string, unknown>;
64
64
  protected readonly _parentRunId?: string | undefined;
65
65
  constructor(runId: string, handlers: BaseCallbackHandler[], inheritableHandlers: BaseCallbackHandler[], tags: string[], inheritableTags: string[], metadata: Record<string, unknown>, inheritableMetadata: Record<string, unknown>, _parentRunId?: string | undefined);
66
+ get parentRunId(): string | undefined;
66
67
  handleText(text: string): Promise<void>;
67
68
  }
68
69
  /**
@@ -150,6 +151,7 @@ export declare class CallbackManager extends BaseCallbackManager implements Base
150
151
  copy(additionalHandlers?: BaseCallbackHandler[], inherit?: boolean): CallbackManager;
151
152
  static fromHandlers(handlers: CallbackHandlerMethods): CallbackManager;
152
153
  static configure(inheritableHandlers?: Callbacks, localHandlers?: Callbacks, inheritableTags?: string[], localTags?: string[], inheritableMetadata?: Record<string, unknown>, localMetadata?: Record<string, unknown>, options?: CallbackManagerOptions): Promise<CallbackManager | undefined>;
154
+ static _configureSync(inheritableHandlers?: Callbacks, localHandlers?: Callbacks, inheritableTags?: string[], localTags?: string[], inheritableMetadata?: Record<string, unknown>, localMetadata?: Record<string, unknown>, options?: CallbackManagerOptions): CallbackManager | undefined;
153
155
  }
154
156
  export declare function ensureHandler(handler: BaseCallbackHandler | CallbackHandlerMethods): BaseCallbackHandler;
155
157
  /**
@@ -1,11 +1,11 @@
1
1
  import { v4 as uuidv4 } from "uuid";
2
2
  import { BaseCallbackHandler, } from "./base.js";
3
3
  import { ConsoleCallbackHandler } from "../tracers/console.js";
4
- import { getTracingV2CallbackHandler } from "../tracers/initialize.js";
5
4
  import { getBufferString } from "../messages/utils.js";
6
5
  import { getEnvironmentVariable } from "../utils/env.js";
7
6
  import { LangChainTracer, } from "../tracers/tracer_langchain.js";
8
7
  import { consumeCallback } from "./promises.js";
8
+ import { isTracingEnabled } from "../utils/callbacks.js";
9
9
  if (
10
10
  /* #__PURE__ */ getEnvironmentVariable("LANGCHAIN_TRACING_V2") === "true" &&
11
11
  /* #__PURE__ */ getEnvironmentVariable("LANGCHAIN_CALLBACKS_BACKGROUND") !==
@@ -38,7 +38,7 @@ export class BaseCallbackManager {
38
38
  /**
39
39
  * Base class for run manager in LangChain.
40
40
  */
41
- class BaseRunManager {
41
+ export class BaseRunManager {
42
42
  constructor(runId, handlers, inheritableHandlers, tags, inheritableTags, metadata, inheritableMetadata, _parentRunId) {
43
43
  Object.defineProperty(this, "runId", {
44
44
  enumerable: true,
@@ -89,6 +89,9 @@ class BaseRunManager {
89
89
  value: _parentRunId
90
90
  });
91
91
  }
92
+ get parentRunId() {
93
+ return this._parentRunId;
94
+ }
92
95
  async handleText(text) {
93
96
  await Promise.all(this.handlers.map((handler) => consumeCallback(async () => {
94
97
  try {
@@ -577,6 +580,10 @@ export class CallbackManager extends BaseCallbackManager {
577
580
  return manager;
578
581
  }
579
582
  static async configure(inheritableHandlers, localHandlers, inheritableTags, localTags, inheritableMetadata, localMetadata, options) {
583
+ return this._configureSync(inheritableHandlers, localHandlers, inheritableTags, localTags, inheritableMetadata, localMetadata, options);
584
+ }
585
+ // TODO: Deprecate async method in favor of this one.
586
+ static _configureSync(inheritableHandlers, localHandlers, inheritableTags, localTags, inheritableMetadata, localMetadata, options) {
580
587
  let callbackManager;
581
588
  if (inheritableHandlers || localHandlers) {
582
589
  if (Array.isArray(inheritableHandlers) || !inheritableHandlers) {
@@ -592,8 +599,7 @@ export class CallbackManager extends BaseCallbackManager {
592
599
  }
593
600
  const verboseEnabled = getEnvironmentVariable("LANGCHAIN_VERBOSE") === "true" ||
594
601
  options?.verbose;
595
- const tracingV2Enabled = getEnvironmentVariable("LANGCHAIN_TRACING_V2") === "true" ||
596
- getEnvironmentVariable("LANGSMITH_TRACING") === "true";
602
+ const tracingV2Enabled = isTracingEnabled();
597
603
  const tracingEnabled = tracingV2Enabled ||
598
604
  (getEnvironmentVariable("LANGCHAIN_TRACING") ?? false);
599
605
  if (verboseEnabled || tracingEnabled) {
@@ -608,7 +614,7 @@ export class CallbackManager extends BaseCallbackManager {
608
614
  if (tracingEnabled &&
609
615
  !callbackManager.handlers.some((handler) => handler.name === "langchain_tracer")) {
610
616
  if (tracingV2Enabled) {
611
- const tracerV2 = await getTracingV2CallbackHandler();
617
+ const tracerV2 = new LangChainTracer();
612
618
  callbackManager.addHandler(tracerV2, true);
613
619
  // handoff between langchain and langsmith/traceable
614
620
  // override the parent run ID
@@ -8,7 +8,6 @@ const zod_1 = require("zod");
8
8
  const p_retry_1 = __importDefault(require("p-retry"));
9
9
  const uuid_1 = require("uuid");
10
10
  const traceable_1 = require("langsmith/singletons/traceable");
11
- const manager_js_1 = require("../callbacks/manager.cjs");
12
11
  const log_stream_js_1 = require("../tracers/log_stream.cjs");
13
12
  const event_stream_js_1 = require("../tracers/event_stream.cjs");
14
13
  const serializable_js_1 = require("../load/serializable.cjs");
@@ -1574,12 +1573,16 @@ class RunnableLambda extends Runnable {
1574
1573
  }
1575
1574
  }
1576
1575
  }
1576
+ const childConfig = (0, config_js_1.patchConfig)(config, {
1577
+ callbacks: runManager?.getChild(),
1578
+ recursionLimit: (config?.recursionLimit ?? config_js_1.DEFAULT_RECURSION_LIMIT) - 1,
1579
+ });
1577
1580
  const output = await new Promise((resolve, reject) => {
1578
- void index_js_1.AsyncLocalStorageProviderSingleton.getInstance().run(config, async () => {
1581
+ void index_js_1.AsyncLocalStorageProviderSingleton.getInstance().run(childConfig, async () => {
1579
1582
  try {
1580
1583
  const res = await this.func(finalChunk, {
1581
- ...config,
1582
- config,
1584
+ ...childConfig,
1585
+ config: childConfig,
1583
1586
  });
1584
1587
  resolve(res);
1585
1588
  }
@@ -1592,21 +1595,18 @@ class RunnableLambda extends Runnable {
1592
1595
  if (config?.recursionLimit === 0) {
1593
1596
  throw new Error("Recursion limit reached.");
1594
1597
  }
1595
- const stream = await output.stream(finalChunk, (0, config_js_1.patchConfig)(config, {
1596
- callbacks: runManager?.getChild(),
1597
- recursionLimit: (config?.recursionLimit ?? config_js_1.DEFAULT_RECURSION_LIMIT) - 1,
1598
- }));
1598
+ const stream = await output.stream(finalChunk, childConfig);
1599
1599
  for await (const chunk of stream) {
1600
1600
  yield chunk;
1601
1601
  }
1602
1602
  }
1603
1603
  else if ((0, iter_js_1.isAsyncIterable)(output)) {
1604
- for await (const chunk of (0, iter_js_1.consumeAsyncIterableInContext)(config, output)) {
1604
+ for await (const chunk of (0, iter_js_1.consumeAsyncIterableInContext)(childConfig, output)) {
1605
1605
  yield chunk;
1606
1606
  }
1607
1607
  }
1608
1608
  else if ((0, iter_js_1.isIterableIterator)(output)) {
1609
- for (const chunk of (0, iter_js_1.consumeIteratorInContext)(config, output)) {
1609
+ for (const chunk of (0, iter_js_1.consumeIteratorInContext)(childConfig, output)) {
1610
1610
  yield chunk;
1611
1611
  }
1612
1612
  }
@@ -1677,13 +1677,14 @@ class RunnableWithFallbacks extends Runnable {
1677
1677
  }
1678
1678
  }
1679
1679
  async invoke(input, options) {
1680
- const callbackManager_ = await manager_js_1.CallbackManager.configure(options?.callbacks, undefined, options?.tags, undefined, options?.metadata);
1681
- const { runId, ...otherOptions } = options ?? {};
1682
- const runManager = await callbackManager_?.handleChainStart(this.toJSON(), _coerceToDict(input, "input"), runId, undefined, undefined, undefined, otherOptions?.runName);
1680
+ const config = (0, config_js_1.ensureConfig)(options);
1681
+ const callbackManager_ = await (0, config_js_1.getCallbackManagerForConfig)(options);
1682
+ const { runId, ...otherConfigFields } = config;
1683
+ const runManager = await callbackManager_?.handleChainStart(this.toJSON(), _coerceToDict(input, "input"), runId, undefined, undefined, undefined, otherConfigFields?.runName);
1683
1684
  let firstError;
1684
1685
  for (const runnable of this.runnables()) {
1685
1686
  try {
1686
- const output = await runnable.invoke(input, (0, config_js_1.patchConfig)(otherOptions, { callbacks: runManager?.getChild() }));
1687
+ const output = await runnable.invoke(input, (0, config_js_1.patchConfig)(otherConfigFields, { callbacks: runManager?.getChild() }));
1687
1688
  await runManager?.handleChainEnd(_coerceToDict(output, "output"));
1688
1689
  return output;
1689
1690
  }
@@ -1704,7 +1705,7 @@ class RunnableWithFallbacks extends Runnable {
1704
1705
  throw new Error("Not implemented.");
1705
1706
  }
1706
1707
  const configList = this._getOptionsList(options ?? {}, inputs.length);
1707
- const callbackManagers = await Promise.all(configList.map((config) => manager_js_1.CallbackManager.configure(config?.callbacks, undefined, config?.tags, undefined, config?.metadata)));
1708
+ const callbackManagers = await Promise.all(configList.map((config) => (0, config_js_1.getCallbackManagerForConfig)(config)));
1708
1709
  const runManagers = await Promise.all(callbackManagers.map(async (callbackManager, i) => {
1709
1710
  const handleStartRes = await callbackManager?.handleChainStart(this.toJSON(), _coerceToDict(inputs[i], "input"), configList[i].runId, undefined, undefined, undefined, configList[i].runName);
1710
1711
  delete configList[i].runId;
@@ -10,8 +10,10 @@ import { Run } from "../tracers/base.js";
10
10
  import { Graph } from "./graph.js";
11
11
  export { type RunnableInterface, RunnableBatchOptions };
12
12
  export type RunnableFunc<RunInput, RunOutput> = (input: RunInput, options?: ({
13
+ /** @deprecated Use top-level config fields instead. */
13
14
  config?: RunnableConfig;
14
15
  } & RunnableConfig) | Record<string, any> | (Record<string, any> & {
16
+ /** @deprecated Use top-level config fields instead. */
15
17
  config: RunnableConfig;
16
18
  } & RunnableConfig)) => RunOutput | Promise<RunOutput>;
17
19
  export type RunnableMapLike<RunInput, RunOutput> = {
@@ -2,7 +2,6 @@ import { z } from "zod";
2
2
  import pRetry from "p-retry";
3
3
  import { v4 as uuidv4 } from "uuid";
4
4
  import { isTraceableFunction, } from "langsmith/singletons/traceable";
5
- import { CallbackManager, } from "../callbacks/manager.js";
6
5
  import { LogStreamCallbackHandler, RunLog, RunLogPatch, isLogStreamHandler, } from "../tracers/log_stream.js";
7
6
  import { EventStreamCallbackHandler, isStreamEventsHandler, } from "../tracers/event_stream.js";
8
7
  import { Serializable } from "../load/serializable.js";
@@ -1560,12 +1559,16 @@ export class RunnableLambda extends Runnable {
1560
1559
  }
1561
1560
  }
1562
1561
  }
1562
+ const childConfig = patchConfig(config, {
1563
+ callbacks: runManager?.getChild(),
1564
+ recursionLimit: (config?.recursionLimit ?? DEFAULT_RECURSION_LIMIT) - 1,
1565
+ });
1563
1566
  const output = await new Promise((resolve, reject) => {
1564
- void AsyncLocalStorageProviderSingleton.getInstance().run(config, async () => {
1567
+ void AsyncLocalStorageProviderSingleton.getInstance().run(childConfig, async () => {
1565
1568
  try {
1566
1569
  const res = await this.func(finalChunk, {
1567
- ...config,
1568
- config,
1570
+ ...childConfig,
1571
+ config: childConfig,
1569
1572
  });
1570
1573
  resolve(res);
1571
1574
  }
@@ -1578,21 +1581,18 @@ export class RunnableLambda extends Runnable {
1578
1581
  if (config?.recursionLimit === 0) {
1579
1582
  throw new Error("Recursion limit reached.");
1580
1583
  }
1581
- const stream = await output.stream(finalChunk, patchConfig(config, {
1582
- callbacks: runManager?.getChild(),
1583
- recursionLimit: (config?.recursionLimit ?? DEFAULT_RECURSION_LIMIT) - 1,
1584
- }));
1584
+ const stream = await output.stream(finalChunk, childConfig);
1585
1585
  for await (const chunk of stream) {
1586
1586
  yield chunk;
1587
1587
  }
1588
1588
  }
1589
1589
  else if (isAsyncIterable(output)) {
1590
- for await (const chunk of consumeAsyncIterableInContext(config, output)) {
1590
+ for await (const chunk of consumeAsyncIterableInContext(childConfig, output)) {
1591
1591
  yield chunk;
1592
1592
  }
1593
1593
  }
1594
1594
  else if (isIterableIterator(output)) {
1595
- for (const chunk of consumeIteratorInContext(config, output)) {
1595
+ for (const chunk of consumeIteratorInContext(childConfig, output)) {
1596
1596
  yield chunk;
1597
1597
  }
1598
1598
  }
@@ -1661,13 +1661,14 @@ export class RunnableWithFallbacks extends Runnable {
1661
1661
  }
1662
1662
  }
1663
1663
  async invoke(input, options) {
1664
- const callbackManager_ = await CallbackManager.configure(options?.callbacks, undefined, options?.tags, undefined, options?.metadata);
1665
- const { runId, ...otherOptions } = options ?? {};
1666
- const runManager = await callbackManager_?.handleChainStart(this.toJSON(), _coerceToDict(input, "input"), runId, undefined, undefined, undefined, otherOptions?.runName);
1664
+ const config = ensureConfig(options);
1665
+ const callbackManager_ = await getCallbackManagerForConfig(options);
1666
+ const { runId, ...otherConfigFields } = config;
1667
+ const runManager = await callbackManager_?.handleChainStart(this.toJSON(), _coerceToDict(input, "input"), runId, undefined, undefined, undefined, otherConfigFields?.runName);
1667
1668
  let firstError;
1668
1669
  for (const runnable of this.runnables()) {
1669
1670
  try {
1670
- const output = await runnable.invoke(input, patchConfig(otherOptions, { callbacks: runManager?.getChild() }));
1671
+ const output = await runnable.invoke(input, patchConfig(otherConfigFields, { callbacks: runManager?.getChild() }));
1671
1672
  await runManager?.handleChainEnd(_coerceToDict(output, "output"));
1672
1673
  return output;
1673
1674
  }
@@ -1688,7 +1689,7 @@ export class RunnableWithFallbacks extends Runnable {
1688
1689
  throw new Error("Not implemented.");
1689
1690
  }
1690
1691
  const configList = this._getOptionsList(options ?? {}, inputs.length);
1691
- const callbackManagers = await Promise.all(configList.map((config) => CallbackManager.configure(config?.callbacks, undefined, config?.tags, undefined, config?.metadata)));
1692
+ const callbackManagers = await Promise.all(configList.map((config) => getCallbackManagerForConfig(config)));
1692
1693
  const runManagers = await Promise.all(callbackManagers.map(async (callbackManager, i) => {
1693
1694
  const handleStartRes = await callbackManager?.handleChainStart(this.toJSON(), _coerceToDict(inputs[i], "input"), configList[i].runId, undefined, undefined, undefined, configList[i].runName);
1694
1695
  delete configList[i].runId;
@@ -89,25 +89,47 @@ const PRIMITIVES = new Set(["string", "number", "boolean"]);
89
89
  * should not be called with a default or prepopulated config argument.
90
90
  */
91
91
  function ensureConfig(config) {
92
- const loadedConfig = config ?? index_js_1.AsyncLocalStorageProviderSingleton.getInstance().getStore();
92
+ const implicitConfig = index_js_1.AsyncLocalStorageProviderSingleton.getInstance().getStore();
93
93
  let empty = {
94
94
  tags: [],
95
95
  metadata: {},
96
- callbacks: undefined,
97
96
  recursionLimit: 25,
98
97
  runId: undefined,
99
98
  };
100
- if (loadedConfig) {
101
- empty = { ...empty, ...loadedConfig };
99
+ if (implicitConfig) {
100
+ // Don't allow runId to be loaded implicitly, as this can cause
101
+ // child runs to improperly inherit their parents' run ids.
102
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
103
+ const { runId, ...rest } = implicitConfig;
104
+ empty = Object.entries(rest).reduce(
105
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
106
+ (currentConfig, [key, value]) => {
107
+ if (value !== undefined) {
108
+ // eslint-disable-next-line no-param-reassign
109
+ currentConfig[key] = value;
110
+ }
111
+ return currentConfig;
112
+ }, empty);
113
+ }
114
+ if (config) {
115
+ empty = Object.entries(config).reduce(
116
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
117
+ (currentConfig, [key, value]) => {
118
+ if (value !== undefined) {
119
+ // eslint-disable-next-line no-param-reassign
120
+ currentConfig[key] = value;
121
+ }
122
+ return currentConfig;
123
+ }, empty);
102
124
  }
103
- if (loadedConfig?.configurable) {
104
- for (const key of Object.keys(loadedConfig.configurable)) {
105
- if (PRIMITIVES.has(typeof loadedConfig.configurable[key]) &&
125
+ if (empty?.configurable) {
126
+ for (const key of Object.keys(empty.configurable)) {
127
+ if (PRIMITIVES.has(typeof empty.configurable[key]) &&
106
128
  !empty.metadata?.[key]) {
107
129
  if (!empty.metadata) {
108
130
  empty.metadata = {};
109
131
  }
110
- empty.metadata[key] = loadedConfig.configurable[key];
132
+ empty.metadata[key] = empty.configurable[key];
111
133
  }
112
134
  }
113
135
  }
@@ -84,25 +84,47 @@ const PRIMITIVES = new Set(["string", "number", "boolean"]);
84
84
  * should not be called with a default or prepopulated config argument.
85
85
  */
86
86
  export function ensureConfig(config) {
87
- const loadedConfig = config ?? AsyncLocalStorageProviderSingleton.getInstance().getStore();
87
+ const implicitConfig = AsyncLocalStorageProviderSingleton.getInstance().getStore();
88
88
  let empty = {
89
89
  tags: [],
90
90
  metadata: {},
91
- callbacks: undefined,
92
91
  recursionLimit: 25,
93
92
  runId: undefined,
94
93
  };
95
- if (loadedConfig) {
96
- empty = { ...empty, ...loadedConfig };
94
+ if (implicitConfig) {
95
+ // Don't allow runId to be loaded implicitly, as this can cause
96
+ // child runs to improperly inherit their parents' run ids.
97
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
98
+ const { runId, ...rest } = implicitConfig;
99
+ empty = Object.entries(rest).reduce(
100
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
101
+ (currentConfig, [key, value]) => {
102
+ if (value !== undefined) {
103
+ // eslint-disable-next-line no-param-reassign
104
+ currentConfig[key] = value;
105
+ }
106
+ return currentConfig;
107
+ }, empty);
108
+ }
109
+ if (config) {
110
+ empty = Object.entries(config).reduce(
111
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
112
+ (currentConfig, [key, value]) => {
113
+ if (value !== undefined) {
114
+ // eslint-disable-next-line no-param-reassign
115
+ currentConfig[key] = value;
116
+ }
117
+ return currentConfig;
118
+ }, empty);
97
119
  }
98
- if (loadedConfig?.configurable) {
99
- for (const key of Object.keys(loadedConfig.configurable)) {
100
- if (PRIMITIVES.has(typeof loadedConfig.configurable[key]) &&
120
+ if (empty?.configurable) {
121
+ for (const key of Object.keys(empty.configurable)) {
122
+ if (PRIMITIVES.has(typeof empty.configurable[key]) &&
101
123
  !empty.metadata?.[key]) {
102
124
  if (!empty.metadata) {
103
125
  empty.metadata = {};
104
126
  }
105
- empty.metadata[key] = loadedConfig.configurable[key];
127
+ empty.metadata[key] = empty.configurable[key];
106
128
  }
107
129
  }
108
130
  }
@@ -211,7 +211,7 @@ class RunnableWithMessageHistory extends base_js_1.RunnableBinding {
211
211
  async _enterHistory(
212
212
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
213
213
  input, kwargs) {
214
- const history = kwargs?.config?.configurable?.messageHistory;
214
+ const history = kwargs?.configurable?.messageHistory;
215
215
  const messages = await history.getMessages();
216
216
  if (this.historyMessagesKey === undefined) {
217
217
  return messages.concat(this._getInputMessages(input));
@@ -85,9 +85,7 @@ export declare class RunnableWithMessageHistory<RunInput, RunOutput> extends Run
85
85
  constructor(fields: RunnableWithMessageHistoryInputs<RunInput, RunOutput>);
86
86
  _getInputMessages(inputValue: string | BaseMessage | Array<BaseMessage> | Record<string, any>): Array<BaseMessage>;
87
87
  _getOutputMessages(outputValue: string | BaseMessage | Array<BaseMessage> | Record<string, any>): Array<BaseMessage>;
88
- _enterHistory(input: any, kwargs?: {
89
- config?: RunnableConfig;
90
- }): Promise<BaseMessage[]>;
88
+ _enterHistory(input: any, kwargs?: RunnableConfig): Promise<BaseMessage[]>;
91
89
  _exitHistory(run: Run, config: RunnableConfig): Promise<void>;
92
90
  _mergeConfig(...configs: Array<RunnableConfig | undefined>): Promise<Partial<RunnableConfig>>;
93
91
  }
@@ -208,7 +208,7 @@ export class RunnableWithMessageHistory extends RunnableBinding {
208
208
  async _enterHistory(
209
209
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
210
210
  input, kwargs) {
211
- const history = kwargs?.config?.configurable?.messageHistory;
211
+ const history = kwargs?.configurable?.messageHistory;
212
212
  const messages = await history.getMessages();
213
213
  if (this.historyMessagesKey === undefined) {
214
214
  return messages.concat(this._getInputMessages(input));
@@ -373,19 +373,19 @@ test("Create a runnable sequence with a static method with invalid output and ca
373
373
  test("RunnableSequence can pass config to every step in batched request", async () => {
374
374
  let numSeen = 0;
375
375
  const addOne = (x, options) => {
376
- if (options?.config?.configurable?.isPresent === true) {
376
+ if (options?.configurable?.isPresent === true) {
377
377
  numSeen += 1;
378
378
  }
379
379
  return x + 1;
380
380
  };
381
381
  const addTwo = (x, options) => {
382
- if (options?.config?.configurable?.isPresent === true) {
382
+ if (options?.configurable?.isPresent === true) {
383
383
  numSeen += 1;
384
384
  }
385
385
  return x + 2;
386
386
  };
387
387
  const addThree = (x, options) => {
388
- if (options?.config?.configurable?.isPresent === true) {
388
+ if (options?.configurable?.isPresent === true) {
389
389
  numSeen += 1;
390
390
  }
391
391
  return x + 3;
@@ -958,7 +958,7 @@ test("Chat model that supports streaming, but is invoked, should still emit on_s
958
958
  event: "on_chat_model_start",
959
959
  name: "my_model",
960
960
  run_id: expect.any(String),
961
- tags: expect.arrayContaining(["seq:step:2", "my_model", "my_chain"]),
961
+ tags: expect.arrayContaining(["my_model", "my_chain"]),
962
962
  metadata: {
963
963
  foo: "bar",
964
964
  a: "b",
@@ -976,7 +976,7 @@ test("Chat model that supports streaming, but is invoked, should still emit on_s
976
976
  {
977
977
  event: "on_chat_model_stream",
978
978
  run_id: expect.any(String),
979
- tags: expect.arrayContaining(["my_chain", "my_model", "seq:step:2"]),
979
+ tags: expect.arrayContaining(["my_chain", "my_model"]),
980
980
  metadata: {
981
981
  a: "b",
982
982
  foo: "bar",
@@ -989,7 +989,7 @@ test("Chat model that supports streaming, but is invoked, should still emit on_s
989
989
  {
990
990
  event: "on_chat_model_stream",
991
991
  run_id: expect.any(String),
992
- tags: expect.arrayContaining(["my_chain", "my_model", "seq:step:2"]),
992
+ tags: expect.arrayContaining(["my_chain", "my_model"]),
993
993
  metadata: {
994
994
  a: "b",
995
995
  foo: "bar",
@@ -1002,7 +1002,7 @@ test("Chat model that supports streaming, but is invoked, should still emit on_s
1002
1002
  {
1003
1003
  event: "on_chat_model_stream",
1004
1004
  run_id: expect.any(String),
1005
- tags: expect.arrayContaining(["my_chain", "my_model", "seq:step:2"]),
1005
+ tags: expect.arrayContaining(["my_chain", "my_model"]),
1006
1006
  metadata: {
1007
1007
  a: "b",
1008
1008
  foo: "bar",
@@ -1015,7 +1015,7 @@ test("Chat model that supports streaming, but is invoked, should still emit on_s
1015
1015
  {
1016
1016
  event: "on_chat_model_stream",
1017
1017
  run_id: expect.any(String),
1018
- tags: expect.arrayContaining(["my_chain", "my_model", "seq:step:2"]),
1018
+ tags: expect.arrayContaining(["my_chain", "my_model"]),
1019
1019
  metadata: {
1020
1020
  a: "b",
1021
1021
  foo: "bar",
@@ -1029,7 +1029,7 @@ test("Chat model that supports streaming, but is invoked, should still emit on_s
1029
1029
  event: "on_chat_model_end",
1030
1030
  name: "my_model",
1031
1031
  run_id: expect.any(String),
1032
- tags: expect.arrayContaining(["seq:step:2", "my_model", "my_chain"]),
1032
+ tags: expect.arrayContaining(["my_model", "my_chain"]),
1033
1033
  metadata: {
1034
1034
  foo: "bar",
1035
1035
  a: "b",
@@ -1172,7 +1172,7 @@ test("Chat model that doesn't support streaming, but is invoked, should emit one
1172
1172
  event: "on_chat_model_start",
1173
1173
  name: "my_model",
1174
1174
  run_id: expect.any(String),
1175
- tags: expect.arrayContaining(["seq:step:2", "my_model", "my_chain"]),
1175
+ tags: expect.arrayContaining(["my_model", "my_chain"]),
1176
1176
  metadata: {
1177
1177
  foo: "bar",
1178
1178
  a: "b",
@@ -1190,7 +1190,7 @@ test("Chat model that doesn't support streaming, but is invoked, should emit one
1190
1190
  {
1191
1191
  event: "on_chat_model_stream",
1192
1192
  run_id: expect.any(String),
1193
- tags: expect.arrayContaining(["my_chain", "my_model", "seq:step:2"]),
1193
+ tags: expect.arrayContaining(["my_chain", "my_model"]),
1194
1194
  metadata: {
1195
1195
  a: "b",
1196
1196
  foo: "bar",
@@ -1204,7 +1204,7 @@ test("Chat model that doesn't support streaming, but is invoked, should emit one
1204
1204
  event: "on_chat_model_end",
1205
1205
  name: "my_model",
1206
1206
  run_id: expect.any(String),
1207
- tags: expect.arrayContaining(["seq:step:2", "my_model", "my_chain"]),
1207
+ tags: expect.arrayContaining(["my_model", "my_chain"]),
1208
1208
  metadata: {
1209
1209
  foo: "bar",
1210
1210
  a: "b",
@@ -1356,7 +1356,7 @@ test("LLM that supports streaming, but is invoked, should still emit on_stream e
1356
1356
  },
1357
1357
  },
1358
1358
  name: "my_model",
1359
- tags: ["seq:step:2", "my_model", "my_chain"],
1359
+ tags: ["my_model", "my_chain"],
1360
1360
  run_id: expect.any(String),
1361
1361
  metadata: {
1362
1362
  foo: "bar",
@@ -1372,7 +1372,7 @@ test("LLM that supports streaming, but is invoked, should still emit on_stream e
1372
1372
  },
1373
1373
  run_id: expect.any(String),
1374
1374
  name: "my_model",
1375
- tags: ["seq:step:2", "my_model", "my_chain"],
1375
+ tags: ["my_model", "my_chain"],
1376
1376
  metadata: {
1377
1377
  foo: "bar",
1378
1378
  a: "b",
@@ -1387,7 +1387,7 @@ test("LLM that supports streaming, but is invoked, should still emit on_stream e
1387
1387
  },
1388
1388
  run_id: expect.any(String),
1389
1389
  name: "my_model",
1390
- tags: ["seq:step:2", "my_model", "my_chain"],
1390
+ tags: ["my_model", "my_chain"],
1391
1391
  metadata: {
1392
1392
  foo: "bar",
1393
1393
  a: "b",
@@ -1402,7 +1402,7 @@ test("LLM that supports streaming, but is invoked, should still emit on_stream e
1402
1402
  },
1403
1403
  run_id: expect.any(String),
1404
1404
  name: "my_model",
1405
- tags: ["seq:step:2", "my_model", "my_chain"],
1405
+ tags: ["my_model", "my_chain"],
1406
1406
  metadata: {
1407
1407
  foo: "bar",
1408
1408
  a: "b",
@@ -1417,7 +1417,7 @@ test("LLM that supports streaming, but is invoked, should still emit on_stream e
1417
1417
  },
1418
1418
  run_id: expect.any(String),
1419
1419
  name: "my_model",
1420
- tags: ["seq:step:2", "my_model", "my_chain"],
1420
+ tags: ["my_model", "my_chain"],
1421
1421
  metadata: {
1422
1422
  foo: "bar",
1423
1423
  a: "b",
@@ -1443,7 +1443,7 @@ test("LLM that supports streaming, but is invoked, should still emit on_stream e
1443
1443
  },
1444
1444
  run_id: expect.any(String),
1445
1445
  name: "my_model",
1446
- tags: ["seq:step:2", "my_model", "my_chain"],
1446
+ tags: ["my_model", "my_chain"],
1447
1447
  metadata: {
1448
1448
  foo: "bar",
1449
1449
  a: "b",
@@ -1587,7 +1587,7 @@ test("LLM that doesn't support streaming, but is invoked, should emit one on_str
1587
1587
  },
1588
1588
  },
1589
1589
  name: "my_model",
1590
- tags: ["seq:step:2", "my_model", "my_chain"],
1590
+ tags: ["my_model", "my_chain"],
1591
1591
  run_id: expect.any(String),
1592
1592
  metadata: {
1593
1593
  foo: "bar",
@@ -1603,7 +1603,7 @@ test("LLM that doesn't support streaming, but is invoked, should emit one on_str
1603
1603
  },
1604
1604
  run_id: expect.any(String),
1605
1605
  name: "my_model",
1606
- tags: ["seq:step:2", "my_model", "my_chain"],
1606
+ tags: ["my_model", "my_chain"],
1607
1607
  metadata: {
1608
1608
  foo: "bar",
1609
1609
  a: "b",
@@ -1629,7 +1629,7 @@ test("LLM that doesn't support streaming, but is invoked, should emit one on_str
1629
1629
  },
1630
1630
  run_id: expect.any(String),
1631
1631
  name: "my_model",
1632
- tags: ["seq:step:2", "my_model", "my_chain"],
1632
+ tags: ["my_model", "my_chain"],
1633
1633
  metadata: {
1634
1634
  foo: "bar",
1635
1635
  a: "b",
@@ -1,8 +1,22 @@
1
1
  import { test, expect } from "@jest/globals";
2
+ import { v4 } from "uuid";
2
3
  import { AsyncLocalStorage } from "node:async_hooks";
3
4
  import { AsyncLocalStorageProviderSingleton } from "../index.js";
4
5
  import { RunnableLambda } from "../../runnables/base.js";
5
6
  import { FakeListChatModel } from "../../utils/testing/index.js";
7
+ import { getCallbackManagerForConfig } from "../../runnables/config.js";
8
+ import { BaseCallbackHandler } from "../../callbacks/base.js";
9
+ class FakeCallbackHandler extends BaseCallbackHandler {
10
+ constructor() {
11
+ super(...arguments);
12
+ Object.defineProperty(this, "name", {
13
+ enumerable: true,
14
+ configurable: true,
15
+ writable: true,
16
+ value: `fake-${v4()}`
17
+ });
18
+ }
19
+ }
6
20
  test("Config should be automatically populated after setting global async local storage", async () => {
7
21
  const inner = RunnableLambda.from((_, config) => config);
8
22
  const outer = RunnableLambda.from(async (input) => {
@@ -32,7 +46,6 @@ test("Config should be automatically populated after setting global async local
32
46
  });
33
47
  const chunks = [];
34
48
  for await (const chunk of stream) {
35
- console.log(chunk);
36
49
  chunks.push(chunk);
37
50
  }
38
51
  expect(chunks.length).toEqual(1);
@@ -58,7 +71,6 @@ test("Config should be automatically populated after setting global async local
58
71
  });
59
72
  const chunks2 = [];
60
73
  for await (const chunk of stream2) {
61
- console.log(chunk);
62
74
  chunks2.push(chunk);
63
75
  }
64
76
  expect(chunks2.length).toEqual(1);
@@ -90,17 +102,38 @@ test("Config should be automatically populated after setting global async local
90
102
  const eventStream = await outer4.streamEvents({ hi: true }, { version: "v1" });
91
103
  const events = [];
92
104
  for await (const event of eventStream) {
93
- console.log(event);
94
105
  events.push(event);
95
106
  }
96
107
  expect(events.filter((event) => event.event === "on_llm_start").length).toEqual(1);
97
108
  });
98
109
  test("Runnable streamEvents method with streaming nested in a RunnableLambda", async () => {
99
110
  AsyncLocalStorageProviderSingleton.initializeGlobalInstance(new AsyncLocalStorage());
111
+ const asyncLocalStorage = AsyncLocalStorageProviderSingleton.getInstance();
100
112
  const chat = new FakeListChatModel({
101
113
  responses: ["Hello"],
102
114
  });
115
+ const outerRunId = v4();
116
+ const innerRunId = v4();
117
+ const innerRunId2 = v4();
118
+ const dummyHandler = new FakeCallbackHandler();
103
119
  const myFunc = async (input) => {
120
+ const outerCallbackManager = await getCallbackManagerForConfig(asyncLocalStorage.getStore());
121
+ expect(outerCallbackManager?.getParentRunId()).toEqual(outerRunId);
122
+ const nestedLambdaWithOverriddenCallbacks = RunnableLambda.from(async (_, config) => {
123
+ expect(config?.callbacks?.handlers).toEqual([]);
124
+ });
125
+ await nestedLambdaWithOverriddenCallbacks.invoke(input, {
126
+ runId: innerRunId,
127
+ callbacks: [],
128
+ });
129
+ const nestedLambdaWithoutOverriddenCallbacks = RunnableLambda.from(async (_, config) => {
130
+ const innerCallbackManager = await getCallbackManagerForConfig(asyncLocalStorage.getStore());
131
+ expect(innerCallbackManager?.getParentRunId()).toEqual(innerRunId2);
132
+ expect(config?.callbacks?.handlers).toContain(dummyHandler);
133
+ });
134
+ await nestedLambdaWithoutOverriddenCallbacks.invoke(input, {
135
+ runId: innerRunId2,
136
+ });
104
137
  for await (const _ of await chat.stream(input)) {
105
138
  // no-op
106
139
  }
@@ -109,8 +142,9 @@ test("Runnable streamEvents method with streaming nested in a RunnableLambda", a
109
142
  const events = [];
110
143
  for await (const event of myNestedLambda.streamEvents("hello", {
111
144
  version: "v1",
145
+ runId: outerRunId,
146
+ callbacks: [dummyHandler],
112
147
  })) {
113
- console.log(event);
114
148
  events.push(event);
115
149
  }
116
150
  const chatModelStreamEvent = events.find((event) => {
@@ -24,6 +24,8 @@ async function getTracingCallbackHandler(session) {
24
24
  }
25
25
  exports.getTracingCallbackHandler = getTracingCallbackHandler;
26
26
  /**
27
+ * @deprecated Instantiate directly using the LangChainTracer constructor.
28
+ *
27
29
  * Function that returns an instance of `LangChainTracer`. It does not
28
30
  * load any session data.
29
31
  * @returns An instance of `LangChainTracer`.
@@ -11,6 +11,8 @@ import { LangChainTracerV1 } from "./tracer_langchain_v1.js";
11
11
  */
12
12
  export declare function getTracingCallbackHandler(session?: string): Promise<LangChainTracerV1>;
13
13
  /**
14
+ * @deprecated Instantiate directly using the LangChainTracer constructor.
15
+ *
14
16
  * Function that returns an instance of `LangChainTracer`. It does not
15
17
  * load any session data.
16
18
  * @returns An instance of `LangChainTracer`.
@@ -20,6 +20,8 @@ export async function getTracingCallbackHandler(session) {
20
20
  return tracer;
21
21
  }
22
22
  /**
23
+ * @deprecated Instantiate directly using the LangChainTracer constructor.
24
+ *
23
25
  * Function that returns an instance of `LangChainTracer`. It does not
24
26
  * load any session data.
25
27
  * @returns An instance of `LangChainTracer`.
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isTracingEnabled = void 0;
4
+ const env_js_1 = require("./env.cjs");
5
+ const isTracingEnabled = (tracingEnabled) => {
6
+ if (tracingEnabled !== undefined) {
7
+ return tracingEnabled;
8
+ }
9
+ const envVars = [
10
+ "LANGSMITH_TRACING_V2",
11
+ "LANGCHAIN_TRACING_V2",
12
+ "LANGSMITH_TRACING",
13
+ "LANGCHAIN_TRACING",
14
+ ];
15
+ return !!envVars.find((envVar) => (0, env_js_1.getEnvironmentVariable)(envVar) === "true");
16
+ };
17
+ exports.isTracingEnabled = isTracingEnabled;
@@ -0,0 +1 @@
1
+ export declare const isTracingEnabled: (tracingEnabled?: boolean) => boolean;
@@ -0,0 +1,13 @@
1
+ import { getEnvironmentVariable } from "./env.js";
2
+ export const isTracingEnabled = (tracingEnabled) => {
3
+ if (tracingEnabled !== undefined) {
4
+ return tracingEnabled;
5
+ }
6
+ const envVars = [
7
+ "LANGSMITH_TRACING_V2",
8
+ "LANGCHAIN_TRACING_V2",
9
+ "LANGSMITH_TRACING",
10
+ "LANGCHAIN_TRACING",
11
+ ];
12
+ return !!envVars.find((envVar) => getEnvironmentVariable(envVar) === "true");
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/core",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "Core LangChain.js abstractions and schemas",
5
5
  "type": "module",
6
6
  "engines": {
@@ -473,15 +473,6 @@
473
473
  "import": "./utils/async_caller.js",
474
474
  "require": "./utils/async_caller.cjs"
475
475
  },
476
- "./utils/beta_warning": {
477
- "types": {
478
- "import": "./utils/beta_warning.d.ts",
479
- "require": "./utils/beta_warning.d.cts",
480
- "default": "./utils/beta_warning.d.ts"
481
- },
482
- "import": "./utils/beta_warning.js",
483
- "require": "./utils/beta_warning.cjs"
484
- },
485
476
  "./utils/chunk_array": {
486
477
  "types": {
487
478
  "import": "./utils/chunk_array.d.ts",
@@ -771,10 +762,6 @@
771
762
  "utils/async_caller.js",
772
763
  "utils/async_caller.d.ts",
773
764
  "utils/async_caller.d.cts",
774
- "utils/beta_warning.cjs",
775
- "utils/beta_warning.js",
776
- "utils/beta_warning.d.ts",
777
- "utils/beta_warning.d.cts",
778
765
  "utils/chunk_array.cjs",
779
766
  "utils/chunk_array.js",
780
767
  "utils/chunk_array.d.ts",
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.betaWarning = void 0;
4
- /**
5
- * Util function for logging a warning when a method is called.
6
- * @param {string} func The name of the function that is in beta.
7
- */
8
- function betaWarning(func) {
9
- console.warn(`The function '${func}' is in beta. It is actively being worked on, so the API may change.`);
10
- }
11
- exports.betaWarning = betaWarning;
@@ -1,5 +0,0 @@
1
- /**
2
- * Util function for logging a warning when a method is called.
3
- * @param {string} func The name of the function that is in beta.
4
- */
5
- export declare function betaWarning(func: string): void;
@@ -1,7 +0,0 @@
1
- /**
2
- * Util function for logging a warning when a method is called.
3
- * @param {string} func The name of the function that is in beta.
4
- */
5
- export function betaWarning(func) {
6
- console.warn(`The function '${func}' is in beta. It is actively being worked on, so the API may change.`);
7
- }
@@ -1 +0,0 @@
1
- module.exports = require('../dist/utils/beta_warning.cjs');
@@ -1 +0,0 @@
1
- export * from '../dist/utils/beta_warning.js'
@@ -1 +0,0 @@
1
- export * from '../dist/utils/beta_warning.js'
@@ -1 +0,0 @@
1
- export * from '../dist/utils/beta_warning.js'