diff --git a/.github/workflows/check-broken-links.yml b/.github/workflows/check-broken-links.yml deleted file mode 100644 index b0f248d00508..000000000000 --- a/.github/workflows/check-broken-links.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Check Broken Links - -on: - workflow_dispatch: - schedule: - - cron: '0 13 * * *' - -jobs: - check-links: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Use Node.js 18.x - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable --mode=skip-build - - name: Build scripts - run: yarn build --filter=@langchain/scripts - - name: Check broken links - run: yarn workspace core_docs check:broken-links:ci diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 7eeac497481f..000000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,45 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: CI - -on: - push: - branches: ["main"] - pull_request: - # Do not run this workflow if only docs changed. - paths-ignore: - - 'docs/**' - workflow_dispatch: # Allows triggering the workflow manually in GitHub UI - - -# If another push to the same PR or branch happens while this workflow is still running, -# cancel the earlier run in favor of the next run. -# -# There's no point in testing an outdated version of the code. GitHub only allows -# a limited number of job runners to be active at the same time, so it's better to cancel -# pointless jobs early so that more useful jobs can run sooner. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - lint: - name: Check linting - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Use Node.js 18.x - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable --mode=skip-build - - name: Check linting - run: yarn run lint - - test-exports: - uses: - ./.github/workflows/test-exports.yml - secrets: inherit diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index cfe5447fa7d3..84a50685863c 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -1,12 +1,8 @@ -name: Dependency compatibility tests - +name: test on: push: branches: ["main"] pull_request: - # Do not run this workflow if only docs changed. - paths-ignore: - - 'docs/**' workflow_dispatch: # Allows triggering the workflow manually in GitHub UI # If another push to the same PR or branch happens while this workflow is still running, @@ -28,159 +24,51 @@ 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 - langchain-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: Test LangChain with latest deps - run: docker compose -f dependency_range_tests/docker-compose.yml run langchain-latest-deps - - langchain-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 with lowest deps - run: docker compose -f dependency_range_tests/docker-compose.yml run langchain-lowest-deps - - # Community - community-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: Install dependencies - run: yarn install --immutable - - name: Build `@langchain/standard-tests` - run: yarn build --filter=@langchain/standard-tests - - name: Test `@langchain/community` with latest deps - run: docker compose -f dependency_range_tests/docker-compose.yml run community-latest-deps - - community-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: Install dependencies - run: yarn install --immutable - - name: Build `@langchain/standard-tests` - run: yarn build --filter=@langchain/standard-tests - - name: Test `@langchain/community` with lowest deps - run: docker compose -f dependency_range_tests/docker-compose.yml run community-lowest-deps - - # OpenAI - openai-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: Install dependencies - run: yarn install --immutable - - 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 openai-latest-deps - - openai-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: Install dependencies - run: yarn install --immutable - - name: Build `@langchain/standard-tests` - run: yarn build --filter=@langchain/standard-tests - - name: Test `@langchain/openai` with lowest deps - run: docker compose -f dependency_range_tests/docker-compose.yml run openai-lowest-deps - - # Anthropic - anthropic-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: Install dependencies - run: yarn install --immutable - - name: Build `@langchain/standard-tests` - run: yarn build --filter=@langchain/standard-tests - - name: Test `@langchain/anthropic` with latest deps - run: docker compose -f dependency_range_tests/docker-compose.yml run anthropic-latest-deps - - anthropic-lowest-deps: + get-changed-files: runs-on: ubuntu-latest + outputs: + changed_files: ${{ steps.get_changes.outputs.changed_files }} steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 with: - node-version: ${{ env.NODE_VERSION }} - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable - - name: Build `@langchain/standard-tests` - run: yarn build --filter=@langchain/standard-tests - - name: Test `@langchain/anthropic` with lowest deps - run: docker compose -f dependency_range_tests/docker-compose.yml run anthropic-lowest-deps + fetch-depth: 2 + # - name: Get changes + # id: get_changes + # run: | + # echo "changed_files<> $GITHUB_OUTPUT + # git diff --name-only -r HEAD^1 HEAD >> $GITHUB_OUTPUT + # echo "EOF" >> $GITHUB_OUTPUT + - name: Get changes + id: get_changes + run: | + echo "changed_files<> $GITHUB_OUTPUT + git diff --name-only -r HEAD^1 HEAD | while read line; do printf "%s\n" "$line"; done >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + - name: Echo changed files + run: echo "${{ steps.get_changes.outputs.changed_files }}" - # Google VertexAI - google-vertexai-latest-deps: + should-pass: + needs: get-changed-files runs-on: ubuntu-latest + if: contains(needs.get-changed-files.outputs.changed_files, 'libs/langchain-cohere/') || contains(needs.get-changed-files.outputs.changed_files, 'langchain-core/') 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: Install dependencies - run: yarn install --immutable - - name: Build `@langchain/standard-tests` - run: yarn build --filter=@langchain/standard-tests - - name: Test `@langchain/google-vertexai` with latest deps - run: docker compose -f dependency_range_tests/docker-compose.yml run google-vertexai-latest-deps - - google-vertexai-lowest-deps: + - name: Use changed files + run: echo "${{ contains(needs.get-changed-files.outputs.changed_files, 'libs/langchain-cohere/') || contains(needs.get-changed-files.outputs.changed_files, 'langchain-core/') }}" + + job-should-fail: + needs: get-changed-files runs-on: ubuntu-latest + if: contains(needs.get-changed-files.outputs.changed_files, 'libs/langchain-community/') || contains(needs.get-changed-files.outputs.changed_files, 'langchain-core/') 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: Install dependencies - run: yarn install --immutable - - name: Build `@langchain/standard-tests` - run: yarn build --filter=@langchain/standard-tests - - name: Test `@langchain/google-vertexai` with lowest deps - run: docker compose -f dependency_range_tests/docker-compose.yml run google-vertexai-lowest-deps \ No newline at end of file + - name: Use changed files + run: echo "${{ contains(needs.get-changed-files.outputs.changed_files, 'libs/langchain-community/') || contains(needs.get-changed-files.outputs.changed_files, 'langchain-core/') }}" + + # cohere-lowest-deps: + # needs: get-changed-files + # runs-on: ubuntu-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + # - name: ECHO BRAH! + # run: echo ${{ needs.get-changed-files.steps.get_changes.outputs.changed_files }} diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 867f87228b99..000000000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,44 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Build Examples - -on: - push: - branches: ["main"] - pull_request: - # Only run if examples, langchain, core, or integration package code changes. - paths: - - 'examples/**' - - 'langchain/**' - - 'langchain-core/**' - - 'libs/**/**' - workflow_dispatch: # Allows triggering the workflow manually in GitHub UI - - -# If another push to the same PR or branch happens while this workflow is still running, -# cancel the earlier run in favor of the next run. -# -# There's no point in testing an outdated version of the code. GitHub only allows -# a limited number of job runners to be active at the same time, so it's better to cancel -# pointless jobs early so that more useful jobs can run sooner. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - name: Build - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v4 - - name: Use Node.js 18.x - uses: actions/setup-node@v3 - with: - node-version: 18.x - - name: Install dependencies - run: yarn install --immutable - - name: Build examples - run: yarn turbo:command build --filter=examples diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index d4cec7500488..000000000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -1,36 +0,0 @@ -# Run formatting on all PRs - -name: Format - -on: - push: - branches: ["main"] - pull_request: - workflow_dispatch: # Allows triggering the workflow manually in GitHub UI - - -# If another push to the same PR or branch happens while this workflow is still running, -# cancel the earlier run in favor of the next run. -# -# There's no point in testing an outdated version of the code. GitHub only allows -# a limited number of job runners to be active at the same time, so it's better to cancel -# pointless jobs early so that more useful jobs can run sooner. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - format: - name: Check formatting - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Use Node.js 18.x - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable --mode=skip-build - - name: Check formatting - run: yarn run format:check diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index 272a681eba74..000000000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,29 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Node.js Integration Tests - -on: - workflow_dispatch: - -jobs: - build: - strategy: - matrix: - os: [macos-latest, windows-latest, ubuntu-latest] - node-version: [18.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable - - run: yarn run ci - - run: yarn workspace langchain run test:integration diff --git a/.github/workflows/people.yml b/.github/workflows/people.yml deleted file mode 100644 index 5662d70c8af0..000000000000 --- a/.github/workflows/people.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: LangChain People - -on: - schedule: - - cron: "0 2 1 * *" - push: - branches: [jacob/people] - workflow_dispatch: - inputs: - debug_enabled: - description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' - required: false - default: 'false' - -jobs: - langchain-people: - if: github.repository_owner == 'langchain-ai' - runs-on: ubuntu-latest - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v4 - # Ref: https://github.com/actions/runner/issues/2033 - - name: Fix git safe.directory in container - run: mkdir -p /home/runner/work/_temp/_github_home && printf "[safe]\n\tdirectory = /github/workspace" > /home/runner/work/_temp/_github_home/.gitconfig - # Allow debugging with tmate - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }} - with: - limit-access-to-actor: true - - uses: ./.github/actions/people - with: - token: ${{ secrets.LANGCHAIN_PEOPLE_GITHUB_TOKEN }} diff --git a/.github/workflows/standard-tests.yml b/.github/workflows/standard-tests.yml deleted file mode 100644 index d474706a7597..000000000000 --- a/.github/workflows/standard-tests.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Standard Tests (Integration) - -on: - workflow_dispatch: - schedule: - - cron: '0 13 * * *' - -jobs: - standard-tests: - runs-on: ubuntu-latest - strategy: - matrix: - package: [anthropic, cohere, google-genai, groq, mistralai] - steps: - - uses: actions/checkout@v4 - - name: Use Node.js 18.x - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable --mode=skip-build - - name: Run standard tests (integration) for ${{ matrix.package }} - run: yarn test:standard:int --filter=@langchain/${{ matrix.package }} - env: - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} - GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} - GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }} - MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} - - # The `@langchain/openai` package contains standard tests for ChatOpenAI and AzureChatOpenAI - # We want to run these separately, so we need to pass the exact path for each test, which means - # we need separate jobs for each test. - standard-tests-openai: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Use Node.js 18.x - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable --mode=skip-build - - name: Build `@langchain/openai` - run: yarn build --filter=@langchain/openai - - name: Run standard tests (integration) for ChatOpenAI - run: yarn workspace @langchain/openai test:single src/tests/chat_models.standard.int.test.ts - env: - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - - standard-tests-azure-openai: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Use Node.js 18.x - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable --mode=skip-build - - name: Build `@langchain/openai` - run: yarn build --filter=@langchain/openai - - name: Run standard tests (integration) for `@langchain/openai` AzureChatOpenAI - run: yarn workspace @langchain/openai test:single src/tests/azure/chat_models.standard.int.test.ts - env: - AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} - AZURE_OPENAI_API_DEPLOYMENT_NAME: "chat" - AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }} - AZURE_OPENAI_BASE_PATH: ${{ secrets.AZURE_OPENAI_BASE_PATH }} - - standard-tests-bedrock: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Use Node.js 18.x - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable --mode=skip-build - - name: Build `@langchain/community` - run: yarn build --filter=@langchain/community - - name: Run standard tests (integration) for `@langchain/community` BedrockChat - run: yarn workspace @langchain/community test:single src/chat_models/tests/chatbedrock.standard.int.test.ts - env: - BEDROCK_AWS_REGION: "us-east-1" - BEDROCK_AWS_SECRET_ACCESS_KEY: ${{ secrets.BEDROCK_AWS_SECRET_ACCESS_KEY }} - BEDROCK_AWS_ACCESS_KEY_ID: ${{ secrets.BEDROCK_AWS_ACCESS_KEY_ID }} diff --git a/.github/workflows/test-exports.yml b/.github/workflows/test-exports.yml deleted file mode 100644 index 22c46d2acb8e..000000000000 --- a/.github/workflows/test-exports.yml +++ /dev/null @@ -1,188 +0,0 @@ -name: Environment tests - -on: - workflow_dispatch: # Allows triggering the workflow manually in GitHub UI - workflow_call: # Allows triggering the workflow from another workflow - -# If another push to the same PR or branch happens while this workflow is still running, -# cancel the earlier run in favor of the next run. -# -# There's no point in testing an outdated version of the code. GitHub only allows -# a limited number of job runners to be active at the same time, so it's better to cancel -# pointless jobs early so that more useful jobs can run sooner. -concurrency: - group: exports-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - PUPPETEER_SKIP_DOWNLOAD: "true" - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true" - NODE_VERSION: "18.x" - -# 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: - exports-esbuild: - runs-on: ubuntu-latest - strategy: - fail-fast: false - 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: Install dependencies - run: yarn install --immutable - - - name: Build dependencies - run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai - shell: bash - - - name: Test esbuild exports - run: docker compose -f environment_tests/docker-compose.yml run test-exports-esbuild - - exports-esm: - runs-on: ubuntu-latest - strategy: - fail-fast: false - 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: Install dependencies - run: yarn install --immutable - - - name: Build dependencies - run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai - shell: bash - - - name: Test esm exports - run: docker compose -f environment_tests/docker-compose.yml run test-exports-esm - - exports-cjs: - runs-on: ubuntu-latest - strategy: - fail-fast: false - 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: Install dependencies - run: yarn install --immutable - - - name: Build dependencies - run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai - shell: bash - - - name: Test cjs exports - run: docker compose -f environment_tests/docker-compose.yml run test-exports-cjs - - exports-cf: - runs-on: ubuntu-latest - strategy: - fail-fast: false - 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: Install dependencies - run: yarn install --immutable - - - name: Build dependencies - run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai - shell: bash - - - name: Test cf exports - run: docker compose -f environment_tests/docker-compose.yml run test-exports-cf - - exports-vercel: - runs-on: ubuntu-latest - strategy: - fail-fast: false - 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: Install dependencies - run: yarn install --immutable - - - name: Build dependencies - run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai - shell: bash - - - name: Test vercel exports - run: docker compose -f environment_tests/docker-compose.yml run test-exports-vercel - - exports-vite: - runs-on: ubuntu-latest - strategy: - fail-fast: false - 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: Install dependencies - run: yarn install --immutable - - - name: Build dependencies - run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai - shell: bash - - - name: Test vite exports - run: docker compose -f environment_tests/docker-compose.yml run test-exports-vite - - exports-tsc: - runs-on: ubuntu-latest - strategy: - fail-fast: false - 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: Install dependencies - run: yarn install --immutable - - - name: Build dependencies - run: yarn build --filter=langchain --filter=@langchain/anthropic --filter=@langchain/community --filter=@langchain/openai - shell: bash - - - name: Test compiling exports with tsc - run: docker compose -f environment_tests/docker-compose.yml run test-exports-tsc - - # exports-bun: - # 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: Install dependencies - # run: yarn install --immutable - # - name: Build - # run: yarn workspace langchain build - # shell: bash - - # - name: Test bun exports - # run: docker compose -f environment_tests/docker-compose.yml run test-exports-bun diff --git a/.github/workflows/unit-tests-langchain-community.yml b/.github/workflows/unit-tests-langchain-community.yml deleted file mode 100644 index 0d3dc85f9f9d..000000000000 --- a/.github/workflows/unit-tests-langchain-community.yml +++ /dev/null @@ -1,54 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Unit Tests (LangChain Community) - -on: - push: - branches: ["main"] - pull_request: - # Only run when LangChain Core, or Community code changes. - paths: - - 'langchain-core/**' - - 'libs/langchain-community/**' - workflow_dispatch: # Allows triggering the workflow manually in GitHub UI - - -# If another push to the same PR or branch happens while this workflow is still running, -# cancel the earlier run in favor of the next run. -# -# There's no point in testing an outdated version of the code. GitHub only allows -# a limited number of job runners to be active at the same time, so it's better to cancel -# pointless jobs early so that more useful jobs can run sooner. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - unit-tests: - name: Unit Tests - strategy: - matrix: - os: [ubuntu-latest] - node-version: [18.x, 20.x] - # See Node.js release schedule at https://nodejs.org/en/about/releases/ - # include: - # - os: windows-latest - # node-version: 20.x - # - os: macos-latest - # node-version: 20.x - runs-on: ${{ matrix.os }} - env: - PUPPETEER_SKIP_DOWNLOAD: "true" - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true" - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable - - name: Test - run: yarn run test:unit:ci --filter=@langchain/community diff --git a/.github/workflows/unit-tests-langchain-core.yml b/.github/workflows/unit-tests-langchain-core.yml deleted file mode 100644 index 2e024faf00ae..000000000000 --- a/.github/workflows/unit-tests-langchain-core.yml +++ /dev/null @@ -1,53 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Unit Tests (LangChain Core) - -on: - push: - branches: ["main"] - pull_request: - # Only run when LangChain Core code changes. - paths: - - 'langchain-core/**' - workflow_dispatch: # Allows triggering the workflow manually in GitHub UI - - -# If another push to the same PR or branch happens while this workflow is still running, -# cancel the earlier run in favor of the next run. -# -# There's no point in testing an outdated version of the code. GitHub only allows -# a limited number of job runners to be active at the same time, so it's better to cancel -# pointless jobs early so that more useful jobs can run sooner. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - unit-tests: - name: Unit Tests - strategy: - matrix: - os: [ubuntu-latest] - node-version: [18.x, 20.x] - # See Node.js release schedule at https://nodejs.org/en/about/releases/ - # include: - # - os: windows-latest - # node-version: 20.x - # - os: macos-latest - # node-version: 20.x - runs-on: ${{ matrix.os }} - env: - PUPPETEER_SKIP_DOWNLOAD: "true" - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true" - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable - - name: Test - run: yarn run test:unit:ci --filter=@langchain/core diff --git a/.github/workflows/unit-tests-langchain-integrations.yml b/.github/workflows/unit-tests-langchain-integrations.yml deleted file mode 100644 index b3782d02ba27..000000000000 --- a/.github/workflows/unit-tests-langchain-integrations.yml +++ /dev/null @@ -1,55 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Unit Tests (LangChain Integrations) - -on: - push: - branches: ["main"] - pull_request: - # Only run when LangChain Core, or integration package code changes. - paths: - - 'langchain-core/**' - - 'libs/**/**' - - '!libs/langchain-community/**' - workflow_dispatch: # Allows triggering the workflow manually in GitHub UI - - -# If another push to the same PR or branch happens while this workflow is still running, -# cancel the earlier run in favor of the next run. -# -# There's no point in testing an outdated version of the code. GitHub only allows -# a limited number of job runners to be active at the same time, so it's better to cancel -# pointless jobs early so that more useful jobs can run sooner. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - unit-tests: - name: Unit Tests - strategy: - matrix: - os: [ubuntu-latest] - node-version: [18.x, 20.x] - # See Node.js release schedule at https://nodejs.org/en/about/releases/ - # include: - # - os: windows-latest - # node-version: 20.x - # - os: macos-latest - # node-version: 20.x - runs-on: ${{ matrix.os }} - env: - PUPPETEER_SKIP_DOWNLOAD: "true" - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true" - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable - - name: Test - run: yarn run test:unit:ci --filter=!@langchain/community --filter=!@langchain/core --filter=!langchain --filter=!api_refs --filter=!core_docs --filter=!create-langchain-integration --filter=!examples diff --git a/.github/workflows/unit-tests-langchain.yml b/.github/workflows/unit-tests-langchain.yml deleted file mode 100644 index a345f5708d43..000000000000 --- a/.github/workflows/unit-tests-langchain.yml +++ /dev/null @@ -1,56 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Unit Tests (LangChain) - -on: - push: - branches: ["main"] - pull_request: - # Only run when LangChain, or LangChain Core code changes. - paths: - - 'langchain/**' - - 'langchain-core/**' - workflow_dispatch: # Allows triggering the workflow manually in GitHub UI - - -# If another push to the same PR or branch happens while this workflow is still running, -# cancel the earlier run in favor of the next run. -# -# There's no point in testing an outdated version of the code. GitHub only allows -# a limited number of job runners to be active at the same time, so it's better to cancel -# pointless jobs early so that more useful jobs can run sooner. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - unit-tests: - name: Unit Tests - strategy: - matrix: - os: [ubuntu-latest] - node-version: [18.x, 20.x] - # See Node.js release schedule at https://nodejs.org/en/about/releases/ - # include: - # - os: windows-latest - # node-version: 20.x - # - os: macos-latest - # node-version: 20.x - runs-on: ${{ matrix.os }} - env: - PUPPETEER_SKIP_DOWNLOAD: "true" - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true" - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: "yarn" - - name: Install dependencies - run: yarn install --immutable - - name: Test - run: yarn run test:unit:ci --filter=langchain - env: - COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} diff --git a/libs/langchain-cohere/src/chat_models.ts b/libs/langchain-cohere/src/chat_models.ts index 2179ec0bbc5d..bb265bc81133 100644 --- a/libs/langchain-cohere/src/chat_models.ts +++ b/libs/langchain-cohere/src/chat_models.ts @@ -38,7 +38,9 @@ export interface ChatCohereInput extends BaseChatModelParams { model?: string; /** * What sampling temperature to use, between 0.0 and 2.0. - * Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + * Higher values like 0.8 will make the output more random, + * while lower values like 0.2 will make it more focused + * and deterministic. * @default {0.3} */ temperature?: number;