Skip to content

Commit

Permalink
Add an environment variable for suppressing warnings (#4212)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 authored Jan 31, 2024
1 parent d133075 commit ba4ad3a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion langchain/src/util/entrypoint_deprecation.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { getEnvironmentVariable } from "./env.js";

export function logVersion010MigrationWarning({
oldEntrypointName,
newEntrypointName,
Expand Down Expand Up @@ -33,5 +35,9 @@ export function logVersion010MigrationWarning({
`This will be mandatory after the next "langchain" minor version bump to 0.2.`,
].join("\n");
}
console.warn(warningText);
if (
getEnvironmentVariable("LANGCHAIN_SUPPRESS_MIGRATION_WARNINGS") !== "true"
) {
console.warn(warningText);
}
}

0 comments on commit ba4ad3a

Please sign in to comment.