diff --git a/pkgs/development/python-modules/langchain-aws/default.nix b/pkgs/development/python-modules/langchain-aws/default.nix index 65dd79a8498bc..83e063e9cc54c 100644 --- a/pkgs/development/python-modules/langchain-aws/default.nix +++ b/pkgs/development/python-modules/langchain-aws/default.nix @@ -2,25 +2,31 @@ lib, buildPythonPackage, fetchFromGitHub, + + # build-system + poetry-core, + + # dependencies boto3, langchain-core, numpy, - poetry-core, - pytestCheckHook, - pytest-asyncio, + + # tests langchain-standard-tests, + pytest-asyncio, + pytestCheckHook, }: buildPythonPackage rec { pname = "langchain-aws"; - version = "0.1.17"; + version = "0.2.0"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain-aws"; rev = "refs/tags/v${version}"; - hash = "sha256-n9nQheuUZMrjZMpR3aqbrRb/AhcgiF4CFO9ROh9aFNc="; + hash = "sha256-P9CfAVpKh7djhUQc3DyyJTWqs9RbrTeLyynLei0x00o="; }; postPatch = '' diff --git a/pkgs/development/python-modules/langchain-azure-dynamic-sessions/default.nix b/pkgs/development/python-modules/langchain-azure-dynamic-sessions/default.nix index 24c1fe66d5eb8..0d9ce18648f69 100644 --- a/pkgs/development/python-modules/langchain-azure-dynamic-sessions/default.nix +++ b/pkgs/development/python-modules/langchain-azure-dynamic-sessions/default.nix @@ -1,38 +1,42 @@ { lib, - azure-identity, buildPythonPackage, fetchFromGitHub, - freezegun, + + # build-system + poetry-core, + + # dependencies + azure-identity, langchain-core, langchain-openai, + + # tests + freezegun, lark, pandas, - poetry-core, pytest-asyncio, pytest-mock, pytest-socket, pytestCheckHook, - pythonOlder, requests-mock, responses, syrupy, toml, + nix-update-script, }: buildPythonPackage rec { pname = "langchain-azure-dynamic-sessions"; - version = "0.1.0"; + version = "0.2.0"; pyproject = true; - disabled = pythonOlder "3.8"; - src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; rev = "refs/tags/langchain-azure-dynamic-sessions==${version}"; - hash = "sha256-jz4IBMnWuk8FsSsyfLN14B0xWZrmZrvEW95a45S+FOo="; + hash = "sha256-tgvoOSr4tpi+tFBan+kw8FZUfUJHcQXv9e1nyeGP0so="; }; sourceRoot = "${src.name}/libs/partners/azure-dynamic-sessions"; diff --git a/pkgs/development/python-modules/langchain-chroma/default.nix b/pkgs/development/python-modules/langchain-chroma/default.nix index 2331babc4d7e4..d5a5a53ac90f4 100644 --- a/pkgs/development/python-modules/langchain-chroma/default.nix +++ b/pkgs/development/python-modules/langchain-chroma/default.nix @@ -12,20 +12,22 @@ buildPythonPackage rec { pname = "langchain-chroma"; - version = "0.1.2"; + version = "0.1.4"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; rev = "refs/tags/langchain-chroma==${version}"; - hash = "sha256-PQ3bepiAqzWhQdKofQSzQKxRrwI6dxBfSNV91462aJE="; + hash = "sha256-pU7H8OYXa+JjdkSO36xESPI6r3xA+9cFXxeJnfpYuHc="; }; sourceRoot = "${src.name}/libs/partners/chroma"; build-system = [ poetry-core ]; + pythonRelaxDeps = [ "chromadb" ]; + dependencies = [ langchain-core chromadb diff --git a/pkgs/development/python-modules/langchain-community/default.nix b/pkgs/development/python-modules/langchain-community/default.nix index ba7b07d1aea64..8f42413117ae0 100644 --- a/pkgs/development/python-modules/langchain-community/default.nix +++ b/pkgs/development/python-modules/langchain-community/default.nix @@ -12,6 +12,7 @@ langchain-core, langchain, langsmith, + pydantic-settings, pyyaml, requests, sqlalchemy, @@ -37,26 +38,29 @@ buildPythonPackage rec { pname = "langchain-community"; - version = "0.2.16"; + version = "0.3.0"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; rev = "refs/tags/langchain-community==${version}"; - hash = "sha256-0FKbx/ZPX7sioof5pMdqpnVWc46+eOiTIseyxwYK49E="; + hash = "sha256-8kF7KlXcWbquRtp8EumkFYhGd0onxifVZsts0SU1dzE="; }; sourceRoot = "${src.name}/libs/community"; build-system = [ poetry-core ]; + pythonRelaxDeps = [ "pydantic-settings" ]; + dependencies = [ aiohttp dataclasses-json langchain-core langchain langsmith + pydantic-settings pyyaml requests sqlalchemy diff --git a/pkgs/development/python-modules/langchain-core/default.nix b/pkgs/development/python-modules/langchain-core/default.nix index 4fa5de47893ed..0d835c4078c5e 100644 --- a/pkgs/development/python-modules/langchain-core/default.nix +++ b/pkgs/development/python-modules/langchain-core/default.nix @@ -34,14 +34,14 @@ buildPythonPackage rec { pname = "langchain-core"; - version = "0.2.38"; + version = "0.3.0"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; rev = "refs/tags/langchain-core==${version}"; - hash = "sha256-3nRirzQe5KCVoeJ29fYelYuOD6r4adJof4NXreyfrzY="; + hash = "sha256-BCqrJuy7R2jT3QmTvYwn8gHX7bc6Tq8HArK+F3PjBhw="; }; sourceRoot = "${src.name}/libs/core"; @@ -102,6 +102,12 @@ buildPythonPackage rec { # Compares with machine-specific timings "test_rate_limit_invoke" "test_rate_limit_stream" + # flaky: assert (1726352133.7419367 - 1726352132.2697523) < 1 + "test_benchmark_model" + + # TypeError: exceptions must be derived from Warning, not + "test_chat_prompt_template_variable_names" + "test_create_model_v2" ] ++ lib.optionals stdenv.isDarwin [ # Langchain-core the following tests due to the test comparing execution time with magic values. diff --git a/pkgs/development/python-modules/langchain-huggingface/default.nix b/pkgs/development/python-modules/langchain-huggingface/default.nix index 774482e5bbcde..51f201ea694fc 100644 --- a/pkgs/development/python-modules/langchain-huggingface/default.nix +++ b/pkgs/development/python-modules/langchain-huggingface/default.nix @@ -2,39 +2,44 @@ lib, buildPythonPackage, fetchFromGitHub, - freezegun, + + # build-system + poetry-core, + + # dependencies huggingface-hub, langchain-core, sentence-transformers, tokenizers, transformers, + + # tests + freezegun, + httpx, lark, pandas, - poetry-core, pytest-asyncio, pytest-mock, pytest-socket, pytestCheckHook, - pythonOlder, requests-mock, responses, syrupy, toml, + nix-update-script, }: buildPythonPackage rec { pname = "langchain-huggingface"; - version = "0.0.3"; + version = "0.1.0"; pyproject = true; - disabled = pythonOlder "3.8"; - src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; rev = "refs/tags/langchain-huggingface==${version}"; - hash = "sha256-4k3C6T2N7SBM/wP8KAwMQqt9DkXDdYNt2i/OkZilWw0="; + hash = "sha256-ESWhhjWjCbBV/3KjeSwEQzvK6os1mmc3at+8gonfGt4="; }; sourceRoot = "${src.name}/libs/partners/huggingface"; @@ -51,6 +56,7 @@ buildPythonPackage rec { nativeCheckInputs = [ freezegun + httpx lark pandas pytest-asyncio diff --git a/pkgs/development/python-modules/langchain-mongodb/default.nix b/pkgs/development/python-modules/langchain-mongodb/default.nix index 0b0a6b22fd63d..9d8f59e3c771e 100644 --- a/pkgs/development/python-modules/langchain-mongodb/default.nix +++ b/pkgs/development/python-modules/langchain-mongodb/default.nix @@ -2,37 +2,42 @@ lib, buildPythonPackage, fetchFromGitHub, - freezegun, - langchain, + + # build-system + poetry-core, + + # dependencies langchain-core, + numpy, pymongo, + + freezegun, + httpx, + langchain, lark, pandas, - poetry-core, pytest-asyncio, + pytestCheckHook, pytest-mock, pytest-socket, - pytestCheckHook, - pythonOlder, requests-mock, responses, syrupy, toml, + nix-update-script, }: buildPythonPackage rec { pname = "langchain-mongodb"; - version = "0.1.8"; + version = "0.2.0"; pyproject = true; - disabled = pythonOlder "3.8"; - src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; rev = "refs/tags/langchain-mongodb==${version}"; - hash = "sha256-fjSvn9O/CrKBexcwuILXFR7AGx/tZtGDWjA0L6XV4Hk="; + hash = "sha256-Jd9toXkS9dGtSIrJQ/5W+swV1z2BJOJKBtkyGzj3oSc="; }; sourceRoot = "${src.name}/libs/partners/mongodb"; @@ -41,22 +46,18 @@ buildPythonPackage rec { dependencies = [ langchain-core + numpy pymongo ]; nativeCheckInputs = [ freezegun + httpx langchain - lark - pandas pytest-asyncio - pytest-mock - pytest-socket pytestCheckHook - requests-mock - responses + pytest-mock syrupy - toml ]; pytestFlagsArray = [ "tests/unit_tests" ]; diff --git a/pkgs/development/python-modules/langchain-openai/default.nix b/pkgs/development/python-modules/langchain-openai/default.nix index 5bb20007a7ed9..1410e72aeac1b 100644 --- a/pkgs/development/python-modules/langchain-openai/default.nix +++ b/pkgs/development/python-modules/langchain-openai/default.nix @@ -2,38 +2,42 @@ lib, buildPythonPackage, fetchFromGitHub, - freezegun, + + # build-system + poetry-core, + + # dependencies langchain-core, - langchain-standard-tests, openai, tiktoken, + + # tests + freezegun, + langchain-standard-tests, lark, pandas, - poetry-core, pytest-asyncio, + pytestCheckHook, pytest-mock, pytest-socket, - pytestCheckHook, - pythonOlder, requests-mock, responses, syrupy, toml, + nix-update-script, }: buildPythonPackage rec { pname = "langchain-openai"; - version = "0.1.23"; + version = "0.2.0"; pyproject = true; - disabled = pythonOlder "3.8"; - src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; rev = "refs/tags/langchain-openai==${version}"; - hash = "sha256-j+oaC0xmvDBsAREXwKF+kmFlplN43ROH6n9j1+H1ufk="; + hash = "sha256-3wTSvvPOMZciEqPxpcjrcqEpK//qwsEmvZnlZBfjltQ="; }; sourceRoot = "${src.name}/libs/partners/openai"; @@ -57,9 +61,9 @@ buildPythonPackage rec { lark pandas pytest-asyncio + pytestCheckHook pytest-mock pytest-socket - pytestCheckHook requests-mock responses syrupy diff --git a/pkgs/development/python-modules/langchain-standard-tests/default.nix b/pkgs/development/python-modules/langchain-standard-tests/default.nix index 9b45f412f3373..3bec0ee76be3e 100644 --- a/pkgs/development/python-modules/langchain-standard-tests/default.nix +++ b/pkgs/development/python-modules/langchain-standard-tests/default.nix @@ -1,10 +1,19 @@ { lib, buildPythonPackage, + + # build-system poetry-core, + + # dependencies httpx, langchain-core, + syrupy, + + # buildInputs pytest, + + # tests numpy, pytest-asyncio, pytestCheckHook, @@ -23,8 +32,9 @@ buildPythonPackage rec { build-system = [ poetry-core ]; dependencies = [ - langchain-core httpx + langchain-core + syrupy ]; buildInputs = [ pytest ]; diff --git a/pkgs/development/python-modules/langchain-text-splitters/default.nix b/pkgs/development/python-modules/langchain-text-splitters/default.nix index 5832e387e3033..a19f3ceb7d7ef 100644 --- a/pkgs/development/python-modules/langchain-text-splitters/default.nix +++ b/pkgs/development/python-modules/langchain-text-splitters/default.nix @@ -10,31 +10,35 @@ langchain-core, # tests + httpx, pytest-asyncio, pytestCheckHook, }: buildPythonPackage rec { pname = "langchain-text-splitters"; - version = "0.2.4"; + version = "0.3.0"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; rev = "refs/tags/langchain-text-splitters==${version}"; - hash = "sha256-8n5eImRXOG/3tN/59Gd2/GpoGpt7P2ABj0T4pJi6xrk="; + hash = "sha256-Z0UAUhOjC0wgCY/f1aWsnjFyOPYz/6JnloEKT6b6Ii0="; }; sourceRoot = "${src.name}/libs/text-splitters"; build-system = [ poetry-core ]; - dependencies = [ langchain-core ]; + dependencies = [ + langchain-core + ]; pythonImportsCheck = [ "langchain_text_splitters" ]; nativeCheckInputs = [ + httpx pytest-asyncio pytestCheckHook ]; diff --git a/pkgs/development/python-modules/langchain/default.nix b/pkgs/development/python-modules/langchain/default.nix index 59f0c09ec10cd..c2184e84254f3 100644 --- a/pkgs/development/python-modules/langchain/default.nix +++ b/pkgs/development/python-modules/langchain/default.nix @@ -27,6 +27,7 @@ # tests freezegun, + httpx, lark, pandas, pytest-asyncio, @@ -41,14 +42,14 @@ buildPythonPackage rec { pname = "langchain"; - version = "0.2.16"; + version = "0.3.0"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; rev = "refs/tags/langchain==${version}"; - hash = "sha256-8n5eImRXOG/3tN/59Gd2/GpoGpt7P2ABj0T4pJi6xrk="; + hash = "sha256-2dHsZWn1MN/gLnUdYp84gbtWkvB0j0iieij4W9tzPzY="; }; sourceRoot = "${src.name}/libs/langchain"; @@ -75,6 +76,7 @@ buildPythonPackage rec { nativeCheckInputs = [ freezegun + httpx lark pandas pytest-asyncio diff --git a/pkgs/development/python-modules/langgraph-checkpoint-sqlite/default.nix b/pkgs/development/python-modules/langgraph-checkpoint-sqlite/default.nix index b8bf9df2eaa98..e94cca80eb542 100644 --- a/pkgs/development/python-modules/langgraph-checkpoint-sqlite/default.nix +++ b/pkgs/development/python-modules/langgraph-checkpoint-sqlite/default.nix @@ -13,7 +13,7 @@ buildPythonPackage rec { pname = "langgraph-checkpoint-sqlite"; - version = "1.0.2"; + version = "1.0.3"; pyproject = true; disabled = pythonOlder "3.9"; @@ -22,7 +22,7 @@ buildPythonPackage rec { owner = "langchain-ai"; repo = "langgraph"; rev = "refs/tags/checkpointsqlite==${version}"; - hash = "sha256-TUiZOf34jhs+nkeTsprtTdoVqDt7kZd8NxYLKX4l0kQ="; + hash = "sha256-/pHJtK691anqn2It4ZstCGXJS0JGtdKZvqS9f3ly+FQ="; }; sourceRoot = "${src.name}/libs/checkpoint-sqlite"; diff --git a/pkgs/development/python-modules/langgraph-checkpoint/default.nix b/pkgs/development/python-modules/langgraph-checkpoint/default.nix index 82323a80488ca..3857de5bd7353 100644 --- a/pkgs/development/python-modules/langgraph-checkpoint/default.nix +++ b/pkgs/development/python-modules/langgraph-checkpoint/default.nix @@ -39,6 +39,11 @@ buildPythonPackage rec { pytestCheckHook ]; + disabledTests = [ + # AssertionError + "test_serde_jsonplus" + ]; + passthru = { updateScript = langgraph-sdk.updateScript; }; diff --git a/pkgs/development/python-modules/langgraph/default.nix b/pkgs/development/python-modules/langgraph/default.nix index cb442e8919f46..80e2faa682584 100644 --- a/pkgs/development/python-modules/langgraph/default.nix +++ b/pkgs/development/python-modules/langgraph/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, @@ -35,14 +36,14 @@ buildPythonPackage rec { pname = "langgraph"; - version = "0.2.19"; + version = "0.2.21"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langgraph"; rev = "refs/tags/${version}"; - hash = "sha256-qJIZAHftIKyWK0A/MjilalmmB8b8E7JtLnFn156hE08="; + hash = "sha256-1Ch2V85omAKnXK9rMihNtyjIoOvmVUm8Dbdo5GBoik4="; }; postgresqlTestSetupPost = '' @@ -61,6 +62,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "langgraph" ]; + # postgresql doesn't play nicely with the darwin sandbox: + # FATAL: could not create shared memory segment: Operation not permitted + doCheck = !stdenv.isDarwin; + nativeCheckInputs = [ aiosqlite dataclasses-json diff --git a/pkgs/development/python-modules/langsmith/default.nix b/pkgs/development/python-modules/langsmith/default.nix index 16e3b19f71b39..c45edec702bc8 100644 --- a/pkgs/development/python-modules/langsmith/default.nix +++ b/pkgs/development/python-modules/langsmith/default.nix @@ -1,37 +1,40 @@ { lib, stdenv, - anthropic, - attr, buildPythonPackage, + fetchFromGitHub, + + # build-system + poetry-core, + + # dependencies + orjson, + pydantic, + requests, + + # tests + anthropic, dataclasses-json, fastapi, - fetchFromGitHub, freezegun, httpx, instructor, - orjson, - poetry-core, - pydantic, pytest-asyncio, pytestCheckHook, - pythonOlder, - requests, uvicorn, + attr, }: buildPythonPackage rec { pname = "langsmith"; - version = "0.1.99"; + version = "0.1.120"; pyproject = true; - disabled = pythonOlder "3.8"; - src = fetchFromGitHub { owner = "langchain-ai"; repo = "langsmith-sdk"; rev = "refs/tags/v${version}"; - hash = "sha256-aN5HiQAXX7ZlVBzkit4DAw+7KQHI3ck1DLvBPDSKVhM="; + hash = "sha256-K8QIlyQnaTKCBoRCsTQ26KovIIw8uK6HBynEplrB6wI="; }; sourceRoot = "${src.name}/python"; @@ -89,12 +92,12 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; - meta = with lib; { + meta = { description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform"; homepage = "https://github.com/langchain-ai/langsmith-sdk"; changelog = "https://github.com/langchain-ai/langsmith-sdk/releases/tag/v${version}"; - license = licenses.mit; - maintainers = with maintainers; [ natsukium ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ natsukium ]; mainProgram = "langsmith"; }; }