The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
[performance]: Use hard coded `langchain-core` version to avoid `importlib` import (#30744)
Sydney Runkle8f8fea2d7e16
diff --git a/.github/workflows/check_core_versions.yml b/.github/workflows/check_core_versions.ymlnew file mode 100644index 0000000000..e46abba04e--- /dev/null+++ b/.github/workflows/check_core_versions.yml@@ -0,0 +1,29 @@+name: Check `langchain-core` version equality++on:+ pull_request:+ paths:+ - 'libs/core/pyproject.toml'+ - 'libs/core/langchain_core/version.py'++jobs:+ check_version_equality:+ runs-on: ubuntu-latest++ steps:+ - uses: actions/checkout@v4++ - name: Check version equality+ run: |+ PYPROJECT_VERSION=$(grep -Po '(?<=^version = ")[^"]*' libs/core/pyproject.toml)+ VERSION_PY_VERSION=$(grep -Po '(?<=^VERSION = ")[^"]*' libs/core/langchain_core/version.py)++ # Compare the two versions+ if [ "$PYPROJECT_VERSION" != "$VERSION_PY_VERSION" ]; then+ echo "langchain-core versions in pyproject.toml and version.py do not match!"+ echo "pyproject.toml version: $PYPROJECT_VERSION"+ echo "version.py version: $VERSION_PY_VERSION"+ exit 1+ else+ echo "Versions match: $PYPROJECT_VERSION"+ fidiff --git a/libs/core/langchain_core/__init__.py b/libs/core/langchain_core/__init__.pyindex 0326da7c0d..498f503ad3 100644--- a/libs/core/langchain_core/__init__.py+++ b/libs/core/langchain_core/__init__.py@@ -8,18 +8,13 @@ No third-party integrations are defined here. The dependencies are kept purposefvery lightweight."""-from importlib import metadata-from langchain_core._api import (surface_langchain_beta_warnings,surface_langchain_deprecation_warnings,)+from langchain_core.version import VERSION-try:- __version__ = metadata.version(__package__)-except metadata.PackageNotFoundError:- # Case where package metadata is not available.- __version__ = ""+__version__ = VERSIONsurface_langchain_deprecation_warnings()surface_langchain_beta_warnings()diff --git a/libs/core/langchain_core/version.py b/libs/core/langchain_core/version.pynew file mode 100644index 0000000000..0e8bc4ac07--- /dev/null+++ b/libs/core/langchain_core/version.py@@ -0,0 +1,3 @@+"""langchain-core version information and utilities."""++VERSION = "0.3.51"