diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index ee0540fcf7b6..e59587200582 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -28,6 +28,7 @@ env: # Run a separate job for each check in the docker-compose file, # so that they run in parallel instead of overwhelming the default 2 CPU runner. jobs: + # LangChain test-langchain-with-latest-deps: runs-on: ubuntu-latest steps: @@ -54,6 +55,7 @@ jobs: - name: Test LangChain with lowest deps run: docker compose -f dependency_range_tests/docker-compose.yml run test-langchain-with-lowest-deps + # Community test-community-with-latest-deps: runs-on: ubuntu-latest steps: @@ -79,3 +81,30 @@ jobs: cache: "yarn" - name: Test `@langchain/community` with lowest deps run: docker compose -f dependency_range_tests/docker-compose.yml run test-community-with-lowest-deps + + # OpenAI + test-openai-with-latest-deps: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: "yarn" + - name: Build `@langchain/standard-tests` + run: yarn build --filter=@langchain/standard-tests + - name: Test `@langchain/openai` with latest deps + run: docker compose -f dependency_range_tests/docker-compose.yml run test-openai-with-latest-deps + + test-openai-with-lowest-deps: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: "yarn" + - name: Test `@langchain/openai` with lowest deps + run: docker compose -f dependency_range_tests/docker-compose.yml run test-openai-with-lowest-deps diff --git a/dependency_range_tests/docker-compose.yml b/dependency_range_tests/docker-compose.yml index 51b2ccc07183..f9444de91e1c 100644 --- a/dependency_range_tests/docker-compose.yml +++ b/dependency_range_tests/docker-compose.yml @@ -39,7 +39,7 @@ services: - ../libs/langchain-standard-tests:/libs/langchain-standard-tests - ../libs/langchain-community:/libs/langchain-community - ./scripts:/scripts - command: bash /scripts/community/test-with-latest-deps.sh + command: bash /scripts/with_standard_tests/community/test-with-latest-deps.sh test-community-with-lowest-deps: image: node:18 environment: @@ -53,12 +53,33 @@ services: - ../libs/langchain-standard-tests:/libs/langchain-standard-tests - ../libs/langchain-community:/libs/langchain-community - ./scripts:/scripts - command: bash /scripts/community/test-with-lowest-deps.sh - success: - image: alpine:3.14 - command: echo "Success" - depends_on: - test-langchain-with-latest-deps: - condition: service_completed_successfully - test-langchain-with-lowest-deps: - condition: service_completed_successfully + command: bash /scripts/with_standard_tests/community/test-with-lowest-deps.sh + + test-openai-with-latest-deps: + image: node:18 + environment: + PUPPETEER_SKIP_DOWNLOAD: "true" + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true" + COHERE_API_KEY: ${COHERE_API_KEY} + working_dir: /app + volumes: + - ../turbo.json:/turbo.json + - ../package.json:/package.json + - ../libs/langchain-standard-tests:/libs/langchain-standard-tests + - ../libs/langchain-openai:/libs/langchain-openai + - ./scripts:/scripts + command: bash /scripts/with_standard_tests/openai/test-with-latest-deps.sh + test-openai-with-lowest-deps: + image: node:18 + environment: + PUPPETEER_SKIP_DOWNLOAD: "true" + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true" + COHERE_API_KEY: ${COHERE_API_KEY} + working_dir: /app + volumes: + - ../turbo.json:/turbo.json + - ../package.json:/package.json + - ../libs/langchain-standard-tests:/libs/langchain-standard-tests + - ../libs/langchain-openai:/libs/langchain-openai + - ./scripts:/scripts + command: bash /scripts/with_standard_tests/openai/test-with-lowest-deps.sh diff --git a/dependency_range_tests/scripts/community/node/package.json b/dependency_range_tests/scripts/community/node/package.json deleted file mode 100644 index a4622fc74597..000000000000 --- a/dependency_range_tests/scripts/community/node/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "dependency-range-tests", - "version": "0.0.0", - "private": true, - "description": "Tests dependency ranges for LangChain.", - "dependencies": { - "semver": "^7.5.4" - } -} \ No newline at end of file diff --git a/dependency_range_tests/scripts/community/node/update_resolutions_lowest.js b/dependency_range_tests/scripts/community/node/update_resolutions_lowest.js deleted file mode 100644 index 4688cf4d5001..000000000000 --- a/dependency_range_tests/scripts/community/node/update_resolutions_lowest.js +++ /dev/null @@ -1,36 +0,0 @@ -const fs = require("fs"); -const semver = require("semver"); - -const communityPackageJsonPath = "/app/monorepo/libs/langchain-community/package.json"; - -const currentPackageJson = JSON.parse(fs.readFileSync(communityPackageJsonPath)); - -if (currentPackageJson.dependencies["@langchain/core"] && !currentPackageJson.dependencies["@langchain/core"].includes("rc")) { - const minVersion = semver.minVersion( - currentPackageJson.dependencies["@langchain/core"] - ).version; - currentPackageJson.resolutions = { - ...currentPackageJson.resolutions, - "@langchain/core": minVersion, - }; - currentPackageJson.dependencies = { - ...currentPackageJson.dependencies, - "@langchain/core": minVersion, - }; -} - -if (currentPackageJson.dependencies["@langchain/openai"] && !currentPackageJson.dependencies["@langchain/openai"].includes("rc")) { - const minVersion = semver.minVersion( - currentPackageJson.dependencies["@langchain/openai"] - ).version; - currentPackageJson.resolutions = { - ...currentPackageJson.resolutions, - "@langchain/openai": minVersion, - }; - currentPackageJson.dependencies = { - ...currentPackageJson.dependencies, - "@langchain/openai": minVersion, - }; -} - -fs.writeFileSync(communityPackageJsonPath, JSON.stringify(currentPackageJson, null, 2)); diff --git a/dependency_range_tests/scripts/community/node/update_workspace_dependencies.js b/dependency_range_tests/scripts/community/node/update_workspace_dependencies.js deleted file mode 100644 index 755700a9c749..000000000000 --- a/dependency_range_tests/scripts/community/node/update_workspace_dependencies.js +++ /dev/null @@ -1,21 +0,0 @@ -const fs = require("fs"); - -const standardTestsPackageJsonPath = "/app/monorepo/libs/langchain-standard-tests/package.json"; - -const currentPackageJson = JSON.parse(fs.readFileSync(standardTestsPackageJsonPath)); - -if (currentPackageJson.dependencies["@langchain/core"]) { - currentPackageJson.dependencies = { - ...currentPackageJson.dependencies, - "@langchain/core": "latest", - }; -} - -if (currentPackageJson.devDependencies["@langchain/scripts"]) { - currentPackageJson.devDependencies = { - ...currentPackageJson.devDependencies, - "@langchain/scripts": "latest", - }; -} - -fs.writeFileSync(standardTestsPackageJsonPath, JSON.stringify(currentPackageJson, null, 2)); diff --git a/dependency_range_tests/scripts/community/node/yarn.lock b/dependency_range_tests/scripts/community/node/yarn.lock deleted file mode 100644 index 50ac73caa812..000000000000 --- a/dependency_range_tests/scripts/community/node/yarn.lock +++ /dev/null @@ -1,22 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -semver@^7.5.4: - version "7.5.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/dependency_range_tests/scripts/community/test-with-latest-deps.sh b/dependency_range_tests/scripts/community/test-with-latest-deps.sh deleted file mode 100644 index b97d0999c2bb..000000000000 --- a/dependency_range_tests/scripts/community/test-with-latest-deps.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash - -set -euxo pipefail - -export CI=true - -# New monorepo directory paths -monorepo_dir="/app/monorepo" -monorepo_libs_dir="$monorepo_dir/libs" -monorepo_community_dir="$monorepo_libs_dir/langchain-community" -monorepo_standard_tests_dir="$monorepo_libs_dir/langchain-standard-tests" - -# Updater script will not live inside the monorepo -updater_script_dir="/app/updater_script" - -# Original directory paths -original_community_dir="/libs/langchain-community" -original_standard_tests_dir="/libs/langchain-standard-tests" -original_package_json_dir="/package.json" -original_turbo_json_dir="/turbo.json" -original_updater_script_dir="/scripts/community/node" - -# enable extended globbing for omitting build artifacts -shopt -s extglob - -# Create the top level monorepo directory -mkdir -p "$monorepo_dir" - -# Copy `@langchain/standard-tests` WITH build artifacts from the host. -# This is because we build @langchain/standard-tests before running this script. -mkdir -p "$monorepo_standard_tests_dir/" -cp -r "$original_standard_tests_dir"/* "$monorepo_standard_tests_dir/" - -# Copy `@langchain/community` WITHOUT build artifacts from the host. -mkdir -p "$monorepo_community_dir/" -cp -r "$original_community_dir"/!(node_modules|dist|dist-cjs|dist-esm|build|.next|.turbo) "$monorepo_community_dir/" - -# Copy the turbo and package.json files for monorepo -cp "$original_turbo_json_dir" "$monorepo_dir/" -cp "$original_package_json_dir" "$monorepo_dir/" - -# Replace any workspace dependencies in `@langchain/standard-tests` -# with "latest" for the version. -mkdir -p "$updater_script_dir" -cp "$original_updater_script_dir"/* "$updater_script_dir/" - -# Install deps (e.g semver) for the updater script -cd "$updater_script_dir" -yarn -# Run the updater scripts -node "update_workspace_dependencies.js" - -# Navigate back to monorepo root and install dependencies -cd "$monorepo_dir" -yarn - -# Navigate into `@langchain/community` and run tests -# We need to run inside the community directory so turbo repo does -# not try to build the package/it's workspace dependencies. -cd "$monorepo_community_dir" -yarn test diff --git a/dependency_range_tests/scripts/community/test-with-lowest-deps.sh b/dependency_range_tests/scripts/community/test-with-lowest-deps.sh deleted file mode 100644 index 573d8650d06d..000000000000 --- a/dependency_range_tests/scripts/community/test-with-lowest-deps.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash - -set -euxo pipefail - -export CI=true - -# New monorepo directory paths -monorepo_dir="/app/monorepo" -monorepo_libs_dir="$monorepo_dir/libs" -monorepo_community_dir="$monorepo_libs_dir/langchain-community" -monorepo_standard_tests_dir="$monorepo_libs_dir/langchain-standard-tests" - -# Updater script will not live inside the monorepo -updater_script_dir="/app/updater_script" - -# Original directory paths -original_community_dir="/libs/langchain-community" -original_standard_tests_dir="/libs/langchain-standard-tests" -original_package_json_dir="/package.json" -original_turbo_json_dir="/turbo.json" -original_updater_script_dir="/scripts/community/node" - -# enable extended globbing for omitting build artifacts -shopt -s extglob - -# Create the top level monorepo directory -mkdir -p "$monorepo_dir" - -# Copy `@langchain/standard-tests` WITH build artifacts from the host. -# This is because we build @langchain/standard-tests before running this script. -mkdir -p "$monorepo_standard_tests_dir/" -cp -r "$original_standard_tests_dir"/* "$monorepo_standard_tests_dir/" - -# Copy `@langchain/community` WITHOUT build artifacts from the host. -mkdir -p "$monorepo_community_dir/" -cp -r "$original_community_dir"/!(node_modules|dist|dist-cjs|dist-esm|build|.next|.turbo) "$monorepo_community_dir/" - -# Copy the turbo and package.json files for monorepo -cp "$original_turbo_json_dir" "$monorepo_dir/" -cp "$original_package_json_dir" "$monorepo_dir/" - -# Replace any workspace dependencies in `@langchain/standard-tests` -# with "latest" for the version. -mkdir -p "$updater_script_dir" -cp "$original_updater_script_dir"/* "$updater_script_dir/" - -# Install deps (e.g semver) for the updater script -cd "$updater_script_dir" -yarn -# Run the updater scripts -node "update_workspace_dependencies.js" -node "update_resolutions_lowest.js" - -# Navigate back to monorepo root and install dependencies -cd "$monorepo_dir" -yarn - -# Navigate into `@langchain/community` and run tests -# We need to run inside the community directory so turbo repo does -# not try to build the package/it's workspace dependencies. -cd "$monorepo_community_dir" -yarn test diff --git a/dependency_range_tests/scripts/with_standard_tests/community/test-with-latest-deps.sh b/dependency_range_tests/scripts/with_standard_tests/community/test-with-latest-deps.sh index b97d0999c2bb..916c6c4fd09a 100644 --- a/dependency_range_tests/scripts/with_standard_tests/community/test-with-latest-deps.sh +++ b/dependency_range_tests/scripts/with_standard_tests/community/test-with-latest-deps.sh @@ -11,14 +11,14 @@ monorepo_community_dir="$monorepo_libs_dir/langchain-community" monorepo_standard_tests_dir="$monorepo_libs_dir/langchain-standard-tests" # Updater script will not live inside the monorepo -updater_script_dir="/app/updater_script" +standard_tests_updater_script_dir="/app/with_standard_script" # Original directory paths original_community_dir="/libs/langchain-community" original_standard_tests_dir="/libs/langchain-standard-tests" original_package_json_dir="/package.json" original_turbo_json_dir="/turbo.json" -original_updater_script_dir="/scripts/community/node" +original_standard_tests_updater_script_dir="/scripts/with_standard_tests/node" # enable extended globbing for omitting build artifacts shopt -s extglob @@ -41,13 +41,10 @@ cp "$original_package_json_dir" "$monorepo_dir/" # Replace any workspace dependencies in `@langchain/standard-tests` # with "latest" for the version. -mkdir -p "$updater_script_dir" -cp "$original_updater_script_dir"/* "$updater_script_dir/" - -# Install deps (e.g semver) for the updater script -cd "$updater_script_dir" -yarn -# Run the updater scripts +mkdir -p "$standard_tests_updater_script_dir" +cp "$original_standard_tests_updater_script_dir"/* "$standard_tests_updater_script_dir/" +cd "$standard_tests_updater_script_dir" +# Run the updater script node "update_workspace_dependencies.js" # Navigate back to monorepo root and install dependencies diff --git a/dependency_range_tests/scripts/with_standard_tests/community/test-with-lowest-deps.sh b/dependency_range_tests/scripts/with_standard_tests/community/test-with-lowest-deps.sh index 573d8650d06d..f2d4de9cf668 100644 --- a/dependency_range_tests/scripts/with_standard_tests/community/test-with-lowest-deps.sh +++ b/dependency_range_tests/scripts/with_standard_tests/community/test-with-lowest-deps.sh @@ -12,13 +12,15 @@ monorepo_standard_tests_dir="$monorepo_libs_dir/langchain-standard-tests" # Updater script will not live inside the monorepo updater_script_dir="/app/updater_script" +standard_tests_updater_script_dir="/app/with_standard_script" # Original directory paths original_community_dir="/libs/langchain-community" original_standard_tests_dir="/libs/langchain-standard-tests" original_package_json_dir="/package.json" original_turbo_json_dir="/turbo.json" -original_updater_script_dir="/scripts/community/node" +original_updater_script_dir="/scripts/with_standard_tests/community/node" +original_standard_tests_updater_script_dir="/scripts/with_standard_tests/node" # enable extended globbing for omitting build artifacts shopt -s extglob @@ -41,14 +43,21 @@ cp "$original_package_json_dir" "$monorepo_dir/" # Replace any workspace dependencies in `@langchain/standard-tests` # with "latest" for the version. +mkdir -p "$standard_tests_updater_script_dir" +cp "$original_standard_tests_updater_script_dir"/* "$standard_tests_updater_script_dir/" +cd "$standard_tests_updater_script_dir" +# Run the updater script +node "update_workspace_dependencies.js" + +# Navigate back to root +cd "/app" + mkdir -p "$updater_script_dir" cp "$original_updater_script_dir"/* "$updater_script_dir/" - # Install deps (e.g semver) for the updater script cd "$updater_script_dir" yarn -# Run the updater scripts -node "update_workspace_dependencies.js" +# Run the updater script node "update_resolutions_lowest.js" # Navigate back to monorepo root and install dependencies diff --git a/dependency_range_tests/scripts/with_standard_tests/openai/node/update_resolutions_lowest.js b/dependency_range_tests/scripts/with_standard_tests/openai/node/update_resolutions_lowest.js index 4688cf4d5001..4c688d14fd0b 100644 --- a/dependency_range_tests/scripts/with_standard_tests/openai/node/update_resolutions_lowest.js +++ b/dependency_range_tests/scripts/with_standard_tests/openai/node/update_resolutions_lowest.js @@ -1,7 +1,7 @@ const fs = require("fs"); const semver = require("semver"); -const communityPackageJsonPath = "/app/monorepo/libs/langchain-community/package.json"; +const communityPackageJsonPath = "/app/monorepo/libs/langchain-openai/package.json"; const currentPackageJson = JSON.parse(fs.readFileSync(communityPackageJsonPath)); @@ -19,18 +19,4 @@ if (currentPackageJson.dependencies["@langchain/core"] && !currentPackageJson.de }; } -if (currentPackageJson.dependencies["@langchain/openai"] && !currentPackageJson.dependencies["@langchain/openai"].includes("rc")) { - const minVersion = semver.minVersion( - currentPackageJson.dependencies["@langchain/openai"] - ).version; - currentPackageJson.resolutions = { - ...currentPackageJson.resolutions, - "@langchain/openai": minVersion, - }; - currentPackageJson.dependencies = { - ...currentPackageJson.dependencies, - "@langchain/openai": minVersion, - }; -} - fs.writeFileSync(communityPackageJsonPath, JSON.stringify(currentPackageJson, null, 2)); diff --git a/dependency_range_tests/scripts/with_standard_tests/openai/test-with-latest-deps.sh b/dependency_range_tests/scripts/with_standard_tests/openai/test-with-latest-deps.sh index b97d0999c2bb..107e61ae99c5 100644 --- a/dependency_range_tests/scripts/with_standard_tests/openai/test-with-latest-deps.sh +++ b/dependency_range_tests/scripts/with_standard_tests/openai/test-with-latest-deps.sh @@ -7,18 +7,18 @@ export CI=true # New monorepo directory paths monorepo_dir="/app/monorepo" monorepo_libs_dir="$monorepo_dir/libs" -monorepo_community_dir="$monorepo_libs_dir/langchain-community" +monorepo_openai_dir="$monorepo_libs_dir/langchain-openai" monorepo_standard_tests_dir="$monorepo_libs_dir/langchain-standard-tests" # Updater script will not live inside the monorepo -updater_script_dir="/app/updater_script" +standard_tests_updater_script_dir="/app/with_standard_script" # Original directory paths -original_community_dir="/libs/langchain-community" +original_openai_dir="/libs/langchain-openai" original_standard_tests_dir="/libs/langchain-standard-tests" original_package_json_dir="/package.json" original_turbo_json_dir="/turbo.json" -original_updater_script_dir="/scripts/community/node" +original_standard_tests_updater_script_dir="/scripts/with_standard_tests/node" # enable extended globbing for omitting build artifacts shopt -s extglob @@ -31,9 +31,9 @@ mkdir -p "$monorepo_dir" mkdir -p "$monorepo_standard_tests_dir/" cp -r "$original_standard_tests_dir"/* "$monorepo_standard_tests_dir/" -# Copy `@langchain/community` WITHOUT build artifacts from the host. -mkdir -p "$monorepo_community_dir/" -cp -r "$original_community_dir"/!(node_modules|dist|dist-cjs|dist-esm|build|.next|.turbo) "$monorepo_community_dir/" +# Copy `@langchain/openai` WITHOUT build artifacts from the host. +mkdir -p "$monorepo_openai_dir/" +cp -r "$original_openai_dir"/!(node_modules|dist|dist-cjs|dist-esm|build|.next|.turbo) "$monorepo_openai_dir/" # Copy the turbo and package.json files for monorepo cp "$original_turbo_json_dir" "$monorepo_dir/" @@ -41,21 +41,18 @@ cp "$original_package_json_dir" "$monorepo_dir/" # Replace any workspace dependencies in `@langchain/standard-tests` # with "latest" for the version. -mkdir -p "$updater_script_dir" -cp "$original_updater_script_dir"/* "$updater_script_dir/" - -# Install deps (e.g semver) for the updater script -cd "$updater_script_dir" -yarn -# Run the updater scripts +mkdir -p "$standard_tests_updater_script_dir" +cp "$original_standard_tests_updater_script_dir"/* "$standard_tests_updater_script_dir/" +cd "$standard_tests_updater_script_dir" +# Run the updater script node "update_workspace_dependencies.js" # Navigate back to monorepo root and install dependencies cd "$monorepo_dir" yarn -# Navigate into `@langchain/community` and run tests -# We need to run inside the community directory so turbo repo does +# Navigate into `@langchain/openai` and run tests +# We need to run inside the openai directory so turbo repo does # not try to build the package/it's workspace dependencies. -cd "$monorepo_community_dir" +cd "$monorepo_openai_dir" yarn test diff --git a/dependency_range_tests/scripts/with_standard_tests/openai/test-with-lowest-deps.sh b/dependency_range_tests/scripts/with_standard_tests/openai/test-with-lowest-deps.sh index 573d8650d06d..a282f8227cd4 100644 --- a/dependency_range_tests/scripts/with_standard_tests/openai/test-with-lowest-deps.sh +++ b/dependency_range_tests/scripts/with_standard_tests/openai/test-with-lowest-deps.sh @@ -7,18 +7,20 @@ export CI=true # New monorepo directory paths monorepo_dir="/app/monorepo" monorepo_libs_dir="$monorepo_dir/libs" -monorepo_community_dir="$monorepo_libs_dir/langchain-community" +monorepo_openai_dir="$monorepo_libs_dir/langchain-openai" monorepo_standard_tests_dir="$monorepo_libs_dir/langchain-standard-tests" # Updater script will not live inside the monorepo updater_script_dir="/app/updater_script" +standard_tests_updater_script_dir="/app/with_standard_script" # Original directory paths -original_community_dir="/libs/langchain-community" +original_openai_dir="/libs/langchain-openai" original_standard_tests_dir="/libs/langchain-standard-tests" original_package_json_dir="/package.json" original_turbo_json_dir="/turbo.json" -original_updater_script_dir="/scripts/community/node" +original_updater_script_dir="/scripts/with_standard_tests/openai/node" +original_standard_tests_updater_script_dir="/scripts/with_standard_tests/node" # enable extended globbing for omitting build artifacts shopt -s extglob @@ -31,9 +33,9 @@ mkdir -p "$monorepo_dir" mkdir -p "$monorepo_standard_tests_dir/" cp -r "$original_standard_tests_dir"/* "$monorepo_standard_tests_dir/" -# Copy `@langchain/community` WITHOUT build artifacts from the host. -mkdir -p "$monorepo_community_dir/" -cp -r "$original_community_dir"/!(node_modules|dist|dist-cjs|dist-esm|build|.next|.turbo) "$monorepo_community_dir/" +# Copy `@langchain/openai` WITHOUT build artifacts from the host. +mkdir -p "$monorepo_openai_dir/" +cp -r "$original_openai_dir"/!(node_modules|dist|dist-cjs|dist-esm|build|.next|.turbo) "$monorepo_openai_dir/" # Copy the turbo and package.json files for monorepo cp "$original_turbo_json_dir" "$monorepo_dir/" @@ -41,22 +43,29 @@ cp "$original_package_json_dir" "$monorepo_dir/" # Replace any workspace dependencies in `@langchain/standard-tests` # with "latest" for the version. +mkdir -p "$standard_tests_updater_script_dir" +cp "$original_standard_tests_updater_script_dir"/* "$standard_tests_updater_script_dir/" +cd "$standard_tests_updater_script_dir" +# Run the updater script +node "update_workspace_dependencies.js" + +# Navigate back to root +cd "/app" + mkdir -p "$updater_script_dir" cp "$original_updater_script_dir"/* "$updater_script_dir/" - # Install deps (e.g semver) for the updater script cd "$updater_script_dir" yarn -# Run the updater scripts -node "update_workspace_dependencies.js" +# Run the updater script node "update_resolutions_lowest.js" # Navigate back to monorepo root and install dependencies cd "$monorepo_dir" yarn -# Navigate into `@langchain/community` and run tests -# We need to run inside the community directory so turbo repo does +# Navigate into `@langchain/openai` and run tests +# We need to run inside the openai directory so turbo repo does # not try to build the package/it's workspace dependencies. -cd "$monorepo_community_dir" +cd "$monorepo_openai_dir" yarn test