Skip to content

Commit

Permalink
added openai
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Jun 10, 2024
1 parent 75b1c88 commit 4625e22
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 278 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
41 changes: 31 additions & 10 deletions dependency_range_tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
9 changes: 0 additions & 9 deletions dependency_range_tests/scripts/community/node/package.json

This file was deleted.

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions dependency_range_tests/scripts/community/node/yarn.lock

This file was deleted.

61 changes: 0 additions & 61 deletions dependency_range_tests/scripts/community/test-with-latest-deps.sh

This file was deleted.

62 changes: 0 additions & 62 deletions dependency_range_tests/scripts/community/test-with-lowest-deps.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit 4625e22

Please sign in to comment.