diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index a458b42eb4..86a089b8b2 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -377,6 +377,7 @@ jobs: XAI_API_KEY: ${{ secrets.XAI_API_KEY }} DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} PPLX_API_KEY: ${{ secrets.PPLX_API_KEY }} + LANGCHAIN_TESTS_USER_AGENT: ${{ secrets.LANGCHAIN_TESTS_USER_AGENT }} run: make integration_tests working-directory: ${{ inputs.working-directory }} @@ -395,7 +396,7 @@ jobs: contents: read strategy: matrix: - partner: [anthropic] + partner: [openai] fail-fast: false # Continue testing other partners if one fails env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} @@ -409,6 +410,7 @@ jobs: AZURE_OPENAI_LEGACY_CHAT_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_LEGACY_CHAT_DEPLOYMENT_NAME }} AZURE_OPENAI_LLM_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_LLM_DEPLOYMENT_NAME }} AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME }} + LANGCHAIN_TESTS_USER_AGENT: ${{ secrets.LANGCHAIN_TESTS_USER_AGENT }} steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 02709b4a0a..fda2d707a4 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -155,6 +155,7 @@ jobs: WATSONX_APIKEY: ${{ secrets.WATSONX_APIKEY }} WATSONX_PROJECT_ID: ${{ secrets.WATSONX_PROJECT_ID }} XAI_API_KEY: ${{ secrets.XAI_API_KEY }} + LANGCHAIN_TESTS_USER_AGENT: ${{ secrets.LANGCHAIN_TESTS_USER_AGENT }} run: | cd langchain/${{ matrix.working-directory }} make integration_tests diff --git a/libs/core/langchain_core/language_models/chat_models.py b/libs/core/langchain_core/language_models/chat_models.py index ee9a394d9a..7b3f92cb20 100644 --- a/libs/core/langchain_core/language_models/chat_models.py +++ b/libs/core/langchain_core/language_models/chat_models.py @@ -76,7 +76,7 @@ from langchain_core.utils.utils import LC_ID_PREFIX, from_env if TYPE_CHECKING: import uuid - from langchain_model_profiles import ModelProfile # type: ignore[import-not-found] + from langchain_model_profiles import ModelProfile # type: ignore[import-untyped] from langchain_core.output_parsers.base import OutputParserLike from langchain_core.runnables import Runnable, RunnableConfig diff --git a/libs/core/langchain_core/version.py b/libs/core/langchain_core/version.py index 61b0ab4570..611a108116 100644 --- a/libs/core/langchain_core/version.py +++ b/libs/core/langchain_core/version.py @@ -1,3 +1,3 @@ """langchain-core version information and utilities.""" -VERSION = "1.0.2" +VERSION = "1.0.3" diff --git a/libs/core/pyproject.toml b/libs/core/pyproject.toml index 26e577f419..ca130f8696 100644 --- a/libs/core/pyproject.toml +++ b/libs/core/pyproject.toml @@ -16,7 +16,7 @@ dependencies = [ "pydantic>=2.7.4,<3.0.0", ] name = "langchain-core" -version = "1.0.2" +version = "1.0.3" description = "Building applications with LLMs through composability" readme = "README.md" @@ -35,6 +35,7 @@ typing = [ "mypy>=1.18.1,<1.19.0", "types-pyyaml>=6.0.12.2,<7.0.0.0", "types-requests>=2.28.11.5,<3.0.0.0", + "langchain-model-profiles", "langchain-text-splitters", ] dev = [ @@ -56,6 +57,7 @@ test = [ "blockbuster>=1.5.18,<1.6.0", "numpy>=1.26.4; python_version<'3.13'", "numpy>=2.1.0; python_version>='3.13'", + "langchain-model-profiles", "langchain-tests", "pytest-benchmark", "pytest-codspeed", @@ -63,6 +65,7 @@ test = [ test_integration = [] [tool.uv.sources] +langchain-model-profiles = { path = "../model-profiles" } langchain-tests = { path = "../standard-tests" } langchain-text-splitters = { path = "../text-splitters" } diff --git a/libs/core/tests/unit_tests/language_models/chat_models/test_base.py b/libs/core/tests/unit_tests/language_models/chat_models/test_base.py index 7ab177ce48..b20623ad6f 100644 --- a/libs/core/tests/unit_tests/language_models/chat_models/test_base.py +++ b/libs/core/tests/unit_tests/language_models/chat_models/test_base.py @@ -1217,3 +1217,20 @@ def test_get_ls_params() -> None: ls_params = llm._get_ls_params(stop=["stop"]) assert ls_params["ls_stop"] == ["stop"] + + +def test_model_profiles() -> None: + model = GenericFakeChatModel(messages=iter([])) + profile = model.profile + assert profile == {} + + class MyModel(GenericFakeChatModel): + model: str = "gpt-5" + + @property + def _llm_type(self) -> str: + return "openai-chat" + + model = MyModel(messages=iter([])) + profile = model.profile + assert profile diff --git a/libs/core/uv.lock b/libs/core/uv.lock index 072b7092db..137e0d729e 100644 --- a/libs/core/uv.lock +++ b/libs/core/uv.lock @@ -960,7 +960,7 @@ wheels = [ [[package]] name = "langchain-core" -version = "1.0.2" +version = "1.0.3" source = { editable = "." } dependencies = [ { name = "jsonpatch" }, @@ -985,6 +985,7 @@ test = [ { name = "blockbuster" }, { name = "freezegun" }, { name = "grandalf" }, + { name = "langchain-model-profiles" }, { name = "langchain-tests" }, { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "numpy", version = "2.3.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, @@ -1000,6 +1001,7 @@ test = [ { name = "syrupy" }, ] typing = [ + { name = "langchain-model-profiles" }, { name = "langchain-text-splitters" }, { name = "mypy" }, { name = "types-pyyaml" }, @@ -1029,6 +1031,7 @@ test = [ { name = "blockbuster", specifier = ">=1.5.18,<1.6.0" }, { name = "freezegun", specifier = ">=1.2.2,<2.0.0" }, { name = "grandalf", specifier = ">=0.8.0,<1.0.0" }, + { name = "langchain-model-profiles", directory = "../model-profiles" }, { name = "langchain-tests", directory = "../standard-tests" }, { name = "numpy", marker = "python_full_version < '3.13'", specifier = ">=1.26.4" }, { name = "numpy", marker = "python_full_version >= '3.13'", specifier = ">=2.1.0" }, @@ -1045,12 +1048,53 @@ test = [ ] test-integration = [] typing = [ + { name = "langchain-model-profiles", directory = "../model-profiles" }, { name = "langchain-text-splitters", directory = "../text-splitters" }, { name = "mypy", specifier = ">=1.18.1,<1.19.0" }, { name = "types-pyyaml", specifier = ">=6.0.12.2,<7.0.0.0" }, { name = "types-requests", specifier = ">=2.28.11.5,<3.0.0.0" }, ] +[[package]] +name = "langchain-model-profiles" +version = "0.0.2" +source = { directory = "../model-profiles" } +dependencies = [ + { name = "tomli", marker = "python_full_version < '3.11'" }, + { name = "typing-extensions" }, +] + +[package.metadata] +requires-dist = [ + { name = "tomli", marker = "python_full_version < '3.11'", specifier = ">=2.0.0,<3.0.0" }, + { name = "typing-extensions", specifier = ">=4.7.0,<5.0.0" }, +] + +[package.metadata.requires-dev] +dev = [{ name = "httpx", specifier = ">=0.23.0,<1" }] +lint = [ + { name = "langchain", editable = "../langchain_v1" }, + { name = "ruff", specifier = ">=0.12.2,<0.13.0" }, +] +test = [ + { name = "langchain", extras = ["openai"], editable = "../langchain_v1" }, + { name = "langchain-core", editable = "." }, + { name = "pytest", specifier = ">=8.0.0,<9.0.0" }, + { name = "pytest-asyncio", specifier = ">=0.23.2,<2.0.0" }, + { name = "pytest-cov", specifier = ">=4.0.0,<8.0.0" }, + { name = "pytest-mock" }, + { name = "pytest-socket", specifier = ">=0.6.0,<1.0.0" }, + { name = "pytest-watcher", specifier = ">=0.2.6,<1.0.0" }, + { name = "pytest-xdist", specifier = ">=3.6.1,<4.0.0" }, + { name = "syrupy", specifier = ">=4.0.2,<5.0.0" }, + { name = "toml", specifier = ">=0.10.2,<1.0.0" }, +] +test-integration = [{ name = "langchain-core", editable = "." }] +typing = [ + { name = "mypy", specifier = ">=1.18.1,<1.19.0" }, + { name = "types-toml", specifier = ">=0.10.8.20240310,<1.0.0.0" }, +] + [[package]] name = "langchain-tests" version = "1.0.0"