The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
refactor: enhance workflow names and descriptions for clarity (#32262)
Mason Daugherty9d38f170ce49
diff --git a/.github/workflows/_compile_integration_test.yml b/.github/workflows/_compile_integration_test.ymlindex d3267d2b13..566a7ea000 100644--- a/.github/workflows/_compile_integration_test.yml+++ b/.github/workflows/_compile_integration_test.yml@@ -1,4 +1,4 @@-name: compile-integration-test+name: 'π Compile Integration Tests'on:workflow_call:@@ -25,24 +25,24 @@ jobs:working-directory: ${{ inputs.working-directory }}runs-on: ubuntu-latesttimeout-minutes: 20- name: "uv run pytest -m compile tests/integration_tests #${{ inputs.python-version }}"+ name: 'Python ${{ inputs.python-version }}'steps:- uses: actions/checkout@v4- - name: Set up Python ${{ inputs.python-version }} + uv+ - name: 'π Set up Python ${{ inputs.python-version }} + UV'uses: "./.github/actions/uv_setup"with:python-version: ${{ inputs.python-version }}- - name: Install integration dependencies+ - name: 'π¦ Install Integration Dependencies'shell: bashrun: uv sync --group test --group test_integration- - name: Check integration tests compile+ - name: 'π Check Integration Tests Compile'shell: bashrun: uv run pytest -m compile tests/integration_tests- - name: Ensure the tests did not create any additional files+ - name: 'π§Ή Verify Clean Working Directory'shell: bashrun: |set -eudiff --git a/.github/workflows/_integration_test.yml b/.github/workflows/_integration_test.ymlindex 2675cc6e22..48e277e936 100644--- a/.github/workflows/_integration_test.yml+++ b/.github/workflows/_integration_test.yml@@ -1,4 +1,4 @@-name: Integration Tests+name: 'π Integration Tests'on:workflow_dispatch:@@ -24,20 +24,20 @@ jobs:run:working-directory: ${{ inputs.working-directory }}runs-on: ubuntu-latest- name: Python ${{ inputs.python-version }}+ name: 'π Integration Tests (Python ${{ inputs.python-version }})'steps:- uses: actions/checkout@v4- - name: Set up Python ${{ inputs.python-version }} + uv+ - name: 'π Set up Python ${{ inputs.python-version }} + UV'uses: "./.github/actions/uv_setup"with:python-version: ${{ inputs.python-version }}- - name: Install dependencies+ - name: 'π¦ Install Integration Dependencies'shell: bashrun: uv sync --group test --group test_integration- - name: Run integration tests+ - name: 'π Run Integration Tests'shell: bashenv:AI21_API_KEY: ${{ secrets.AI21_API_KEY }}diff --git a/.github/workflows/_lint.yml b/.github/workflows/_lint.ymlindex 22145ad04c..de83f80188 100644--- a/.github/workflows/_lint.yml+++ b/.github/workflows/_lint.yml@@ -1,4 +1,6 @@-name: lint+name: 'π§Ή Code Linting'+# Runs code quality checks using ruff, mypy, and other linting tools+# Checks both package code and test code for consistencyon:workflow_call:@@ -24,19 +26,21 @@ env:UV_FROZEN: "true"jobs:+ # Linting job - runs quality checks on package and test codebuild:- name: "make lint #${{ inputs.python-version }}"+ name: 'Python ${{ inputs.python-version }}'runs-on: ubuntu-latesttimeout-minutes: 20steps:- - uses: actions/checkout@v4+ - name: 'π Checkout Code'+ uses: actions/checkout@v4- - name: Set up Python ${{ inputs.python-version }} + uv+ - name: 'π Set up Python ${{ inputs.python-version }} + UV'uses: "./.github/actions/uv_setup"with:python-version: ${{ inputs.python-version }}- - name: Install dependencies+ - name: 'π¦ Install Lint & Typing Dependencies'# Also installs dev/lint/test/typing dependencies, to ensure we have# type hints for as many of our libraries as possible.# This helps catch errors that require dependencies to be spotted, for example:@@ -49,12 +53,12 @@ jobs:run: |uv sync --group lint --group typing- - name: Analysing the code with our lint+ - name: 'π Analyze Package Code with Linters'working-directory: ${{ inputs.working-directory }}run: |make lint_package- - name: Install unit test dependencies+ - name: 'π¦ Install Unit Test Dependencies'# Also installs dev/lint/test/typing dependencies, to ensure we have# type hints for as many of our libraries as possible.# This helps catch errors that require dependencies to be spotted, for example:@@ -67,13 +71,13 @@ jobs:working-directory: ${{ inputs.working-directory }}run: |uv sync --inexact --group test- - name: Install unit+integration test dependencies+ - name: 'π¦ Install Unit + Integration Test Dependencies'if: ${{ startsWith(inputs.working-directory, 'libs/partners/') }}working-directory: ${{ inputs.working-directory }}run: |uv sync --inexact --group test --group test_integration- - name: Analysing the code with our lint+ - name: 'π Analyze Test Code with Linters'working-directory: ${{ inputs.working-directory }}run: |make lint_testsdiff --git a/.github/workflows/_release.yml b/.github/workflows/_release.ymlindex 56cf99cf82..283ba41bba 100644--- a/.github/workflows/_release.yml+++ b/.github/workflows/_release.yml@@ -1,5 +1,5 @@-name: Release-run-name: Release ${{ inputs.working-directory }} by @${{ github.actor }}+name: 'π Package Release'+run-name: 'π Release ${{ inputs.working-directory }} by @${{ github.actor }}'on:workflow_call:inputs:@@ -18,7 +18,7 @@ on:required: falsetype: booleandefault: false- description: "Release from a non-master branch (danger!)"+ description: "Release from a non-master branch (danger!) - Only use for hotfixes"env:PYTHON_VERSION: "3.11"@@ -26,6 +26,8 @@ env:UV_NO_SYNC: "true"jobs:+ # Build the distribution package and extract version info+ # Runs in isolated environment with minimal permissions for securitybuild:if: github.ref == 'refs/heads/master' || inputs.dangerous-nonmaster-releaseenvironment: Scheduled testingdiff --git a/.github/workflows/_test.yml b/.github/workflows/_test.ymlindex 4bc564e488..0deb2b5359 100644--- a/.github/workflows/_test.yml+++ b/.github/workflows/_test.yml@@ -1,4 +1,6 @@-name: test+name: 'π§ͺ Unit Testing'+# Runs unit tests with both current and minimum supported dependency versions+# to ensure compatibility across the supported rangeon:workflow_call:@@ -20,31 +22,33 @@ env:UV_NO_SYNC: "true"jobs:+ # Main test job - runs unit tests with current deps, then retests with minimum versionsbuild:defaults:run:working-directory: ${{ inputs.working-directory }}runs-on: ubuntu-latesttimeout-minutes: 20- name: "make test #${{ inputs.python-version }}"+ name: 'Python ${{ inputs.python-version }}'steps:- - uses: actions/checkout@v4+ - name: 'π Checkout Code'+ uses: actions/checkout@v4- - name: Set up Python ${{ inputs.python-version }} + uv+ - name: 'π Set up Python ${{ inputs.python-version }} + UV'uses: "./.github/actions/uv_setup"id: setup-pythonwith:python-version: ${{ inputs.python-version }}- - name: Install dependencies+ - name: 'π¦ Install Test Dependencies'shell: bashrun: uv sync --group test --dev- - name: Run core tests+ - name: 'π§ͺ Run Core Unit Tests'shell: bashrun: |make test- - name: Get minimum versions+ - name: 'π Calculate Minimum Dependency Versions'working-directory: ${{ inputs.working-directory }}id: min-versionshell: bash@@ -55,7 +59,7 @@ jobs:echo "min-versions=$min_versions" >> "$GITHUB_OUTPUT"echo "min-versions=$min_versions"- - name: Run unit tests with minimum dependency versions+ - name: 'π§ͺ Run Tests with Minimum Dependencies'if: ${{ steps.min-version.outputs.min-versions != '' }}env:MIN_VERSIONS: ${{ steps.min-version.outputs.min-versions }}@@ -64,7 +68,7 @@ jobs:make testsworking-directory: ${{ inputs.working-directory }}- - name: Ensure the tests did not create any additional files+ - name: 'π§Ή Verify Clean Working Directory'shell: bashrun: |set -eudiff --git a/.github/workflows/_test_doc_imports.yml b/.github/workflows/_test_doc_imports.ymlindex b2ce8f445b..ebc95c77a7 100644--- a/.github/workflows/_test_doc_imports.yml+++ b/.github/workflows/_test_doc_imports.yml@@ -1,4 +1,4 @@-name: test_doc_imports+name: 'π Documentation Import Testing'on:workflow_call:@@ -18,29 +18,30 @@ jobs:build:runs-on: ubuntu-latesttimeout-minutes: 20- name: "check doc imports #${{ inputs.python-version }}"+ name: 'π Check Doc Imports (Python ${{ inputs.python-version }})'steps:- - uses: actions/checkout@v4+ - name: 'π Checkout Code'+ uses: actions/checkout@v4- - name: Set up Python ${{ inputs.python-version }} + uv+ - name: 'π Set up Python ${{ inputs.python-version }} + UV'uses: "./.github/actions/uv_setup"with:python-version: ${{ inputs.python-version }}- - name: Install dependencies+ - name: 'π¦ Install Test Dependencies'shell: bashrun: uv sync --group test- - name: Install langchain editable+ - name: 'π¦ Install LangChain in Editable Mode'run: |VIRTUAL_ENV=.venv uv pip install langchain-experimental langchain-community -e libs/core libs/langchain- - name: Check doc imports+ - name: 'π Validate Documentation Import Statements'shell: bashrun: |uv run python docs/scripts/check_imports.py- - name: Ensure the test did not create any additional files+ - name: 'π§Ή Verify Clean Working Directory'shell: bashrun: |set -eudiff --git a/.github/workflows/_test_pydantic.yml b/.github/workflows/_test_pydantic.ymlindex b290690dad..a6b6b18375 100644--- a/.github/workflows/_test_pydantic.yml+++ b/.github/workflows/_test_pydantic.yml@@ -1,4 +1,4 @@-name: test pydantic intermediate versions+name: 'π Pydantic Version Testing'on:workflow_call:@@ -31,29 +31,30 @@ jobs:working-directory: ${{ inputs.working-directory }}runs-on: ubuntu-latesttimeout-minutes: 20- name: "make test # pydantic: ~=${{ inputs.pydantic-version }}, python: ${{ inputs.python-version }}, "+ name: 'Pydantic ~=${{ inputs.pydantic-version }}'steps:- - uses: actions/checkout@v4+ - name: 'π Checkout Code'+ uses: actions/checkout@v4- - name: Set up Python ${{ inputs.python-version }} + uv+ - name: 'π Set up Python ${{ inputs.python-version }} + UV'uses: "./.github/actions/uv_setup"with:python-version: ${{ inputs.python-version }}- - name: Install dependencies+ - name: 'π¦ Install Test Dependencies'shell: bashrun: uv sync --group test- - name: Overwrite pydantic version+ - name: 'π Install Specific Pydantic Version'shell: bashrun: VIRTUAL_ENV=.venv uv pip install pydantic~=${{ inputs.pydantic-version }}- - name: Run core tests+ - name: 'π§ͺ Run Core Tests'shell: bashrun: |make test- - name: Ensure the tests did not create any additional files+ - name: 'π§Ή Verify Clean Working Directory'shell: bashrun: |set -eudiff --git a/.github/workflows/_test_release.yml b/.github/workflows/_test_release.ymlindex b09b394a81..4f3519fb64 100644--- a/.github/workflows/_test_release.yml+++ b/.github/workflows/_test_release.yml@@ -1,4 +1,4 @@-name: test-release+name: 'π§ͺ Test Release Package'on:workflow_call:@@ -29,7 +29,7 @@ jobs:steps:- uses: actions/checkout@v4- - name: Set up Python + uv+ - name: 'π Set up Python + UV'uses: "./.github/actions/uv_setup"with:python-version: ${{ env.PYTHON_VERSION }}@@ -45,17 +45,17 @@ jobs:# > It is strongly advised to separate jobs for building [...]# > from the publish job.# https://github.com/pypa/gh-action-pypi-publish#non-goals- - name: Build project for distribution+ - name: 'π¦ Build Project for Distribution'run: uv buildworking-directory: ${{ inputs.working-directory }}- - name: Upload build+ - name: 'β¬οΈ Upload Build Artifacts'uses: actions/upload-artifact@v4with:name: test-distpath: ${{ inputs.working-directory }}/dist/- - name: Check Version+ - name: 'π Extract Version Information'id: check-versionshell: pythonworking-directory: ${{ inputs.working-directory }}diff --git a/.github/workflows/api_doc_build.yml b/.github/workflows/api_doc_build.ymlindex 5a1265613c..c97b4e5e19 100644--- a/.github/workflows/api_doc_build.yml+++ b/.github/workflows/api_doc_build.yml@@ -1,13 +1,15 @@-name: API Docs Build+name: 'π API Documentation Build'+# Runs daily or can be triggered manually for immediate updateson:workflow_dispatch:schedule:- - cron: '0 13 * * *'+ - cron: '0 13 * * *' # Daily at 1PM UTCenv:PYTHON_VERSION: "3.11"jobs:+ # Only runs on main repository to prevent unnecessary builds on forksbuild:if: github.repository == 'langchain-ai/langchain' || github.event_name != 'schedule'runs-on: ubuntu-latest@@ -23,7 +25,7 @@ jobs:path: langchain-api-docs-htmltoken: ${{ secrets.TOKEN_GITHUB_API_DOCS_HTML }}- - name: Get repos with yq+ - name: 'π Extract Repository List with yq'id: get-unsorted-reposuses: mikefarah/yq@masterwith:@@ -42,7 +44,7 @@ jobs:| .repo' langchain/libs/packages.yml- - name: Parse YAML and checkout repos+ - name: 'π Parse YAML & Checkout Repositories'env:REPOS_UNSORTED: ${{ steps.get-unsorted-repos.outputs.result }}GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}@@ -70,39 +72,39 @@ jobs:git clone --depth 1 https://github.com/$repo.git $REPO_NAMEdone- - name: Setup Python ${{ env.PYTHON_VERSION }}+ - name: 'π Setup Python ${{ env.PYTHON_VERSION }}'uses: actions/setup-python@v5id: setup-pythonwith:python-version: ${{ env.PYTHON_VERSION }}- - name: Install initial py deps+ - name: 'π¦ Install Initial Python Dependencies'working-directory: langchainrun: |python -m pip install -U uvpython -m uv pip install --upgrade --no-cache-dir pip setuptools pyyaml- - name: Move libs+ - name: 'π¦ Organize Library Directories'run: python langchain/.github/scripts/prep_api_docs_build.py- - name: Rm old html+ - name: 'π§Ή Remove Old HTML Files'run:rm -rf langchain-api-docs-html/api_reference_build/html- - name: Install dependencies+ - name: 'π¦ Install Documentation Dependencies'working-directory: langchainrun: |python -m uv pip install $(ls ./libs/partners | xargs -I {} echo "./libs/partners/{}") --overrides ./docs/vercel_overrides.txtpython -m uv pip install libs/core libs/langchain libs/text-splitters libs/community libs/experimental libs/standard-testspython -m uv pip install -r docs/api_reference/requirements.txt- - name: Set Git config+ - name: 'π§ Configure Git Settings'working-directory: langchainrun: |git config --local user.email "[email protected]"git config --local user.name "Github Actions"- - name: Build docs+ - name: 'π Build API Documentation'working-directory: langchainrun: |python docs/api_reference/create_api_rst.pydiff --git a/.github/workflows/check-broken-links.yml b/.github/workflows/check-broken-links.ymlindex 52bfb6f21a..22a3a22d61 100644--- a/.github/workflows/check-broken-links.yml+++ b/.github/workflows/check-broken-links.yml@@ -1,4 +1,4 @@-name: Check Broken Links+name: 'π Check Broken Links'on:workflow_dispatch:@@ -14,15 +14,15 @@ jobs:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4- - name: Use Node.js 18.x+ - name: 'π’ Setup Node.js 18.x'uses: actions/setup-node@v4with:node-version: 18.xcache: "yarn"cache-dependency-path: ./docs/yarn.lock- - name: Install dependencies+ - name: 'π¦ Install Node Dependencies'run: yarn install --immutable --mode=skip-buildworking-directory: ./docs- - name: Check broken links+ - name: 'π Scan Documentation for Broken Links'run: yarn check-broken-linksworking-directory: ./docsdiff --git a/.github/workflows/check_core_versions.yml b/.github/workflows/check_core_versions.ymlindex c3c0314327..71299549d3 100644--- a/.github/workflows/check_core_versions.yml+++ b/.github/workflows/check_core_versions.yml@@ -1,4 +1,6 @@-name: Check `core` Version Equality+name: 'π Check `core` Version Equality'+# Ensures version numbers in pyproject.toml and version.py stay in sync+# Prevents releases with mismatched version numberson:pull_request:@@ -16,7 +18,7 @@ jobs:steps:- uses: actions/checkout@v4- - name: Check version equality+ - name: 'β Verify pyproject.toml & version.py Match'run: |PYPROJECT_VERSION=$(grep -Po '(?<=^version = ")[^"]*' libs/core/pyproject.toml)VERSION_PY_VERSION=$(grep -Po '(?<=^VERSION = ")[^"]*' libs/core/langchain_core/version.py)diff --git a/.github/workflows/check_diffs.yml b/.github/workflows/check_diffs.ymlindex 2b726e1b9c..73ecb81335 100644--- a/.github/workflows/check_diffs.yml+++ b/.github/workflows/check_diffs.yml@@ -1,4 +1,4 @@-name: CI+name: 'π§ CI'on:push:@@ -6,6 +6,7 @@ on:pull_request:merge_group:+# Optimizes CI performance by canceling redundant workflow runs# 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.#@@ -24,16 +25,23 @@ env:UV_NO_SYNC: "true"jobs:+ # This job analyzes which files changed and creates a dynamic test matrix+ # to only run tests/lints for the affected packages, improving CI efficiencybuild:+ name: 'Detect Changes & Set Matrix'runs-on: ubuntu-lateststeps:- - uses: actions/checkout@v4- - uses: actions/setup-python@v5+ - name: 'π Checkout Code'+ uses: actions/checkout@v4+ - name: 'π Setup Python 3.11'+ uses: actions/setup-python@v5with:python-version: '3.11'- - id: files+ - name: 'π Get Changed Files'+ id: filesuses: Ana06/[email protected]- - id: set-matrix+ - name: 'π Analyze Changed Files & Generate Build Matrix'+ id: set-matrixrun: |python -m pip install packaging requestspython .github/scripts/check_diff.py ${{ steps.files.outputs.all }} >> $GITHUB_OUTPUT@@ -45,8 +53,8 @@ jobs:dependencies: ${{ steps.set-matrix.outputs.dependencies }}test-doc-imports: ${{ steps.set-matrix.outputs.test-doc-imports }}test-pydantic: ${{ steps.set-matrix.outputs.test-pydantic }}+ # Run linting only on packages that have changed fileslint:- name: cd ${{ matrix.job-configs.working-directory }}needs: [ build ]if: ${{ needs.build.outputs.lint != '[]' }}strategy:@@ -59,8 +67,8 @@ jobs:python-version: ${{ matrix.job-configs.python-version }}secrets: inherit+ # Run unit tests only on packages that have changed filestest:- name: cd ${{ matrix.job-configs.working-directory }}needs: [ build ]if: ${{ needs.build.outputs.test != '[]' }}strategy:@@ -73,8 +81,8 @@ jobs:python-version: ${{ matrix.job-configs.python-version }}secrets: inherit+ # Test compatibility with different Pydantic versions for affected packagestest-pydantic:- name: cd ${{ matrix.job-configs.working-directory }}needs: [ build ]if: ${{ needs.build.outputs.test-pydantic != '[]' }}strategy:@@ -95,12 +103,12 @@ jobs:job-configs: ${{ fromJson(needs.build.outputs.test-doc-imports) }}fail-fast: falseuses: ./.github/workflows/_test_doc_imports.yml- secrets: inheritwith:python-version: ${{ matrix.job-configs.python-version }}+ secrets: inherit+ # Verify integration tests compile without actually running them (faster feedback)compile-integration-tests:- name: cd ${{ matrix.job-configs.working-directory }}needs: [ build ]if: ${{ needs.build.outputs.compile-integration-tests != '[]' }}strategy:@@ -113,8 +121,9 @@ jobs:python-version: ${{ matrix.job-configs.python-version }}secrets: inherit+ # Run extended test suites that require additional dependenciesextended-tests:- name: "cd ${{ matrix.job-configs.working-directory }} / make extended_tests #${{ matrix.job-configs.python-version }}"+ name: 'Extended Tests'needs: [ build ]if: ${{ needs.build.outputs.extended-tests != '[]' }}strategy:@@ -130,12 +139,12 @@ jobs:steps:- uses: actions/checkout@v4- - name: Set up Python ${{ matrix.job-configs.python-version }} + uv+ - name: 'π Set up Python ${{ matrix.job-configs.python-version }} + UV'uses: "./.github/actions/uv_setup"with:python-version: ${{ matrix.job-configs.python-version }}- - name: Install dependencies and run extended tests+ - name: 'π¦ Install Dependencies & Run Extended Tests'shell: bashrun: |echo "Running extended tests, installing dependencies with uv..."@@ -144,7 +153,7 @@ jobs:VIRTUAL_ENV=.venv uv pip install -r extended_testing_deps.txtVIRTUAL_ENV=.venv make extended_tests- - name: Ensure the tests did not create any additional files+ - name: 'π§Ή Verify Clean Working Directory'shell: bashrun: |set -eu@@ -156,8 +165,9 @@ jobs:# and `set -e` above will cause the step to fail.echo "$STATUS" | grep 'nothing to commit, working tree clean'+ # Final status check - ensures all required jobs passed before allowing mergeci_success:- name: "CI Success"+ name: 'β CI Success'needs: [build, lint, test, compile-integration-tests, extended-tests, test-doc-imports, test-pydantic]if: |always()@@ -167,7 +177,7 @@ jobs:RESULTS_JSON: ${{ toJSON(needs.*.result) }}EXIT_CODE: ${{!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && '0' || '1'}}steps:- - name: "CI Success"+ - name: 'π All Checks Passed'run: |echo $JOBS_JSONecho $RESULTS_JSONdiff --git a/.github/workflows/check_new_docs.yml b/.github/workflows/check_new_docs.ymlindex a05b62c733..eab0156d1e 100644--- a/.github/workflows/check_new_docs.yml+++ b/.github/workflows/check_new_docs.yml@@ -1,4 +1,4 @@-name: Integration Docs Lint+name: 'π Integration Docs Lint'on:push:@@ -33,6 +33,6 @@ jobs:*.ipynb*.md*.mdx- - name: Check new docs+ - name: 'π Check New Documentation Templates'run: |python docs/scripts/check_templates.py ${{ steps.files.outputs.added }}diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.ymldeleted file mode 100644index 1135f24786..0000000000--- a/.github/workflows/codespell.yml+++ /dev/null@@ -1,35 +0,0 @@-name: CI / cd . / make spell_check--on:- push:- branches: [master, v0.1, v0.2]- pull_request:--permissions:- contents: read--jobs:- codespell:- name: (Check for spelling errors)- runs-on: ubuntu-latest-- steps:- - name: Checkout- uses: actions/checkout@v4-- - name: Install Dependencies- run: |- pip install toml-- - name: Extract Ignore Words List- run: |- # Use a Python script to extract the ignore words list from pyproject.toml- python .github/workflows/extract_ignored_words_list.py- id: extract_ignore_words--# - name: Codespell-# uses: codespell-project/actions-codespell@v2-# with:-# skip: guide_imports.json,*.ambr,./cookbook/data/imdb_top_1000.csv,*.lock-# ignore_words_list: ${{ steps.extract_ignore_words.outputs.ignore_words_list }}-# exclude_file: ./.github/workflows/codespell-excludediff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.ymlindex c738ae286d..c6836d192c 100644--- a/.github/workflows/codspeed.yml+++ b/.github/workflows/codspeed.yml@@ -1,4 +1,4 @@-name: CodSpeed+name: 'β‘ CodSpeed'on:push:@@ -18,7 +18,7 @@ env:jobs:codspeed:- name: Run benchmarks+ name: 'Benchmark'runs-on: ubuntu-lateststrategy:matrix:@@ -38,7 +38,7 @@ jobs:- uses: actions/checkout@v4# We have to use 3.12 as 3.13 is not yet supported- - name: Install uv+ - name: 'π¦ Install UV Package Manager'uses: astral-sh/setup-uv@v6with:python-version: "3.12"@@ -47,11 +47,11 @@ jobs:with:python-version: "3.12"- - name: Install dependencies+ - name: 'π¦ Install Test Dependencies'run: uv sync --group testworking-directory: ${{ matrix.working-directory }}- - name: Run benchmarks ${{ matrix.working-directory }}+ - name: 'β‘ Run Benchmarks: ${{ matrix.working-directory }}'uses: CodSpeedHQ/action@v3with:token: ${{ secrets.CODSPEED_TOKEN }}diff --git a/.github/workflows/people.yml b/.github/workflows/people.ymlindex dd87437ea0..fe6a56fc8f 100644--- a/.github/workflows/people.yml+++ b/.github/workflows/people.yml@@ -1,4 +1,4 @@-name: LangChain People+name: 'π₯ LangChain People'on:schedule:@@ -14,13 +14,13 @@ jobs:permissions:contents: writesteps:- - name: Dump GitHub context+ - 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+ - 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- uses: ./.github/actions/peoplewith:diff --git a/.github/workflows/pr_lint.yml b/.github/workflows/pr_lint.ymlindex f3545d68bf..33b98b0919 100644--- a/.github/workflows/pr_lint.yml+++ b/.github/workflows/pr_lint.yml@@ -4,6 +4,7 @@# Purpose:# Enforces Conventional Commits format for pull request titles to maintain a# clear, consistent, and machine-readable change history across our repository.+# This helps with automated changelog generation and semantic versioning.## Enforced Commit Message Format (Conventional Commits 1.0.0):# <type>[optional scope]: <description>@@ -45,7 +46,7 @@# β’ Conventional Commits spec: https://www.conventionalcommits.org/en/v1.0.0/# ------------------------------------------------------------------------------name: PR Title Lint+name: 'π·οΈ PR Title Lint'permissions:pull-requests: read@@ -55,11 +56,12 @@ on:types: [opened, edited, synchronize]jobs:+ # Validates that PR title follows Conventional Commits specificationlint-pr-title:- name: Validate PR Title+ name: 'Validate PR Title Format'runs-on: ubuntu-lateststeps:- - name: Validate PR Title+ - name: 'β Validate Conventional Commits Format'uses: amannn/action-semantic-pull-request@v5env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}diff --git a/.github/workflows/run_notebooks.yml b/.github/workflows/run_notebooks.ymlindex 9bfe629eb0..fc5b4fab91 100644--- a/.github/workflows/run_notebooks.yml+++ b/.github/workflows/run_notebooks.yml@@ -1,4 +1,4 @@-name: Run Notebooks+name: 'π Run Documentation Notebooks'on:workflow_dispatch:@@ -24,43 +24,43 @@ jobs:build:runs-on: ubuntu-latestif: github.repository == 'langchain-ai/langchain' || github.event_name != 'schedule'- name: "Test docs"+ name: 'π Test Documentation Notebooks'steps:- uses: actions/checkout@v4- - name: Set up Python + uv+ - name: 'π Set up Python + UV'uses: "./.github/actions/uv_setup"with:python-version: ${{ github.event.inputs.python_version || '3.11' }}- - name: 'Authenticate to Google Cloud'+ - name: 'π Authenticate to Google Cloud'id: 'auth'uses: google-github-actions/auth@v2with:credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'- - name: Configure AWS Credentials+ - name: 'π Configure AWS Credentials'uses: aws-actions/configure-aws-credentials@v4with:aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}aws-region: ${{ secrets.AWS_REGION }}- - name: Install dependencies+ - name: 'π¦ Install Dependencies'run: |uv sync --group dev --group test- - name: Pre-download files+ - name: 'π¦ Pre-download Test Files'run: |uv run python docs/scripts/cache_data.pycurl -s https://raw.githubusercontent.com/lerocha/chinook-database/master/ChinookDatabase/DataSources/Chinook_Sqlite.sql | sqlite3 docs/docs/how_to/Chinook.dbcp docs/docs/how_to/Chinook.db docs/docs/tutorials/Chinook.db- - name: Prepare notebooks+ - name: 'π§ Prepare Notebooks for CI'run: |uv run python docs/scripts/prepare_notebooks_for_ci.py --comment-install-cells --working-directory ${{ github.event.inputs.working-directory || 'all' }}- - name: Run notebooks+ - name: 'π Execute Notebooks'env:ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}diff --git a/.github/workflows/scheduled_test.yml b/.github/workflows/scheduled_test.ymlindex 4f2b581364..99662af8f0 100644--- a/.github/workflows/scheduled_test.yml+++ b/.github/workflows/scheduled_test.yml@@ -1,7 +1,7 @@-name: Scheduled Tests+name: 'β° Scheduled Integration Tests'on:- workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI+ workflow_dispatch: # Allows maintainers to trigger the workflow manually in GitHub UIinputs:working-directory-force:type: string@@ -10,7 +10,7 @@ on:type: stringdescription: "Python version to use - defaults to 3.9 and 3.11 in matrix - example value: 3.9"schedule:- - cron: '0 13 * * *'+ - cron: '0 13 * * *' # Runs daily at 1PM UTC (9AM EDT/6AM PDT)permissions:contents: read@@ -22,14 +22,16 @@ env:POETRY_LIBS: ("libs/partners/google-vertexai" "libs/partners/google-genai" "libs/partners/aws")jobs:+ # Generate dynamic test matrix based on input parameters or defaults+ # Only runs on the main repo (for scheduled runs) or when manually triggeredcompute-matrix:if: github.repository_owner == 'langchain-ai' || github.event_name != 'schedule'runs-on: ubuntu-latest- name: Compute matrix+ name: 'π Compute Test Matrix'outputs:matrix: ${{ steps.set-matrix.outputs.matrix }}steps:- - name: Set matrix+ - name: 'π’ Generate Python & Library Matrix'id: set-matrixenv:DEFAULT_LIBS: ${{ env.DEFAULT_LIBS }}@@ -50,9 +52,11 @@ jobs:matrix="{\"python-version\": $python_version, \"working-directory\": $working_directory}"echo $matrixecho "matrix=$matrix" >> $GITHUB_OUTPUT+ # Run integration tests against partner libraries with live API credentials+ # Tests are run with both Poetry and UV depending on the library's setupbuild:if: github.repository_owner == 'langchain-ai' || github.event_name != 'schedule'- name: Python ${{ matrix.python-version }} - ${{ matrix.working-directory }}+ name: 'π Python ${{ matrix.python-version }}: ${{ matrix.working-directory }}'runs-on: ubuntu-latestneeds: [compute-matrix]timeout-minutes: 20@@ -75,7 +79,7 @@ jobs:repository: langchain-ai/langchain-awspath: langchain-aws- - name: Move libs+ - name: 'π¦ Organize External Libraries'run: |rm -rf \langchain/libs/partners/google-genai \@@ -84,7 +88,7 @@ jobs:mv langchain-google/libs/vertexai langchain/libs/partners/google-vertexaimv langchain-aws/libs/aws langchain/libs/partners/aws- - name: Set up Python ${{ matrix.python-version }} with poetry+ - name: 'π Set up Python ${{ matrix.python-version }} + Poetry'if: contains(env.POETRY_LIBS, matrix.working-directory)uses: "./langchain/.github/actions/poetry_setup"with:@@ -93,40 +97,40 @@ jobs:working-directory: langchain/${{ matrix.working-directory }}cache-key: scheduled- - name: Set up Python ${{ matrix.python-version }} + uv+ - name: 'π Set up Python ${{ matrix.python-version }} + UV'if: "!contains(env.POETRY_LIBS, matrix.working-directory)"uses: "./langchain/.github/actions/uv_setup"with:python-version: ${{ matrix.python-version }}- - name: 'Authenticate to Google Cloud'+ - name: 'π Authenticate to Google Cloud'id: 'auth'uses: google-github-actions/auth@v2with:credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'- - name: Configure AWS Credentials+ - name: 'π Configure AWS Credentials'uses: aws-actions/configure-aws-credentials@v4with:aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}aws-region: ${{ secrets.AWS_REGION }}- - name: Install dependencies (poetry)+ - name: 'π¦ Install Dependencies (Poetry)'if: contains(env.POETRY_LIBS, matrix.working-directory)run: |echo "Running scheduled tests, installing dependencies with poetry..."cd langchain/${{ matrix.working-directory }}poetry install --with=test_integration,test- - name: Install dependencies (uv)+ - name: 'π¦ Install Dependencies (UV)'if: "!contains(env.POETRY_LIBS, matrix.working-directory)"run: |echo "Running scheduled tests, installing dependencies with uv..."cd langchain/${{ matrix.working-directory }}uv sync --group test --group test_integration- - name: Run integration tests+ - name: 'π Run Integration Tests'env:OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}@@ -155,14 +159,15 @@ jobs:cd langchain/${{ matrix.working-directory }}make integration_tests- - name: Remove external libraries+ - name: 'π§Ή Clean up External Libraries'+ # Clean up external libraries to avoid affecting git status checkrun: |rm -rf \langchain/libs/partners/google-genai \langchain/libs/partners/google-vertexai \langchain/libs/partners/aws- - name: Ensure tests did not create additional files+ - name: 'π§Ή Verify Clean Working Directory'working-directory: langchainrun: |set -eu