Skip to content

Instantly share code, notes, and snippets.

@glorat
Created June 7, 2024 06:25
Show Gist options
  • Save glorat/4a1d2dcaaa4259ff38092085dd1762c4 to your computer and use it in GitHub Desktop.
Save glorat/4a1d2dcaaa4259ff38092085dd1762c4 to your computer and use it in GitHub Desktop.
Upgrade a typescript project to langchain v0.2
import { updateEntrypointsFrom0_x_xTo0_2_x } from "@langchain/scripts/migrations";
const pathToMyProject = "./functions/src"; // This path is used in the following glob pattern: `${projectPath}/**/*.{ts,tsx,js,jsx}`.
updateEntrypointsFrom0_x_xTo0_2_x({
projectPath: pathToMyProject,
tsConfigPath: "tsconfig.json", // Path to the tsConfig file. This will be used to load all the project files into the script.
// testRun: true, // If true, the script will not save any changes, but will log the changes that would be made.
shouldLog: true,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment