From e3f00a4e056407c7b6d7b82e48bb83052450922e Mon Sep 17 00:00:00 2001 From: natsukium Date: Sun, 14 Jan 2024 16:20:53 +0900 Subject: [PATCH 1/4] python311Packages.langchain-core: init at 0.1.10 --- .../python-modules/langchain-core/default.nix | 55 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/python-modules/langchain-core/default.nix diff --git a/pkgs/development/python-modules/langchain-core/default.nix b/pkgs/development/python-modules/langchain-core/default.nix new file mode 100644 index 000000000000..8ac7bf9173a1 --- /dev/null +++ b/pkgs/development/python-modules/langchain-core/default.nix @@ -0,0 +1,55 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, poetry-core +, anyio +, jsonpatch +, langsmith +, packaging +, pydantic +, pyyaml +, requests +, tenacity +}: + +buildPythonPackage rec { + pname = "langchain-core"; + version = "0.1.10"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchPypi { + pname = "langchain_core"; + inherit version; + hash = "sha256-PJ4TgyZMEC/Mb4ZXANu5QWxJMaJdCsIZX2MRxrhnqhc="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + anyio + jsonpatch + langsmith + packaging + pydantic + pyyaml + requests + tenacity + ]; + + pythonImportsCheck = [ "langchain_core" ]; + + # PyPI source does not have tests + doCheck = false; + + meta = with lib; { + description = "Building applications with LLMs through composability"; + homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/core"; + license = licenses.mit; + maintainers = with maintainers; [ natsukium ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 10046fa26d7e..cd6e52627fd3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6182,6 +6182,8 @@ self: super: with self; { langchain = callPackage ../development/python-modules/langchain { }; + langchain-core = callPackage ../development/python-modules/langchain-core { }; + langcodes = callPackage ../development/python-modules/langcodes { }; langdetect = callPackage ../development/python-modules/langdetect { }; From bc4f1f5d2fa634cc97f26dd7270357eef91929f2 Mon Sep 17 00:00:00 2001 From: natsukium Date: Sun, 14 Jan 2024 16:37:10 +0900 Subject: [PATCH 2/4] python311Packages.langchain-community: init at 0.0.12 --- .../langchain-community/default.nix | 64 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 66 insertions(+) create mode 100644 pkgs/development/python-modules/langchain-community/default.nix diff --git a/pkgs/development/python-modules/langchain-community/default.nix b/pkgs/development/python-modules/langchain-community/default.nix new file mode 100644 index 000000000000..c129f8c8a557 --- /dev/null +++ b/pkgs/development/python-modules/langchain-community/default.nix @@ -0,0 +1,64 @@ +{ lib +, buildPythonPackage +, fetchPypi +, poetry-core +, pythonOlder +, aiohttp +, dataclasses-json +, langchain-core +, langsmith +, numpy +, pyyaml +, requests +, sqlalchemy +, tenacity +, typer +}: + +buildPythonPackage rec { + pname = "langchain-community"; + version = "0.0.12"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchPypi { + pname = "langchain_community"; + inherit version; + hash = "sha256-fP42xSsfuGwQldTewM9Gahx1KnRGEE6LOc8PcFEqSFE="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + aiohttp + dataclasses-json + langchain-core + langsmith + numpy + pyyaml + requests + sqlalchemy + tenacity + ]; + + passthru.optional-dependencies = { + cli = [ + typer + ]; + }; + + pythonImportsCheck = [ "langchain_community" ]; + + # PyPI source does not have tests + doCheck = false; + + meta = with lib; { + description = "Community contributed LangChain integrations"; + homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/community"; + license = licenses.mit; + maintainers = with maintainers; [ natsukium ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cd6e52627fd3..2267f779068a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6182,6 +6182,8 @@ self: super: with self; { langchain = callPackage ../development/python-modules/langchain { }; + langchain-community = callPackage ../development/python-modules/langchain-community { }; + langchain-core = callPackage ../development/python-modules/langchain-core { }; langcodes = callPackage ../development/python-modules/langcodes { }; From 0684a7f8d032b48123db699f2c096f1a9436069d Mon Sep 17 00:00:00 2001 From: natsukium Date: Sun, 14 Jan 2024 16:47:43 +0900 Subject: [PATCH 3/4] python311Packages.langsmith: 0.0.75 -> 0.0.80 Diff: https://github.com/langchain-ai/langsmith-sdk/compare/refs/tags/v0.0.75...v0.0.80 Changelog: https://github.com/langchain-ai/langsmith-sdk/releases/tag/v0.0.80 --- pkgs/development/python-modules/langsmith/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/langsmith/default.nix b/pkgs/development/python-modules/langsmith/default.nix index a24fc80db16c..1fffd07adff8 100644 --- a/pkgs/development/python-modules/langsmith/default.nix +++ b/pkgs/development/python-modules/langsmith/default.nix @@ -12,8 +12,8 @@ buildPythonPackage rec { pname = "langsmith"; - version = "0.0.75"; - format = "pyproject"; + version = "0.0.80"; + pyproject = true; disabled = pythonOlder "3.8"; @@ -21,7 +21,7 @@ buildPythonPackage rec { owner = "langchain-ai"; repo = "langsmith-sdk"; rev = "refs/tags/v${version}"; - hash = "sha256-BbDB3xP3OCRXxbOqFIzFNrpK5+wHbIZ/VlurNXrXpTw="; + hash = "sha256-YFXwM/YiQJzJ1Nf76kuq3WtFhU6dUIHzK4K33+VO/lQ="; }; sourceRoot = "${src.name}/python"; @@ -49,6 +49,8 @@ buildPythonPackage rec { "test_as_runnable_batch" "test_as_runnable_async" "test_as_runnable_async_batch" + # requires git repo + "test_git_info" ]; disabledTestPaths = [ From ba1518e683fb22bd68736bfd28e3a831f1ae63db Mon Sep 17 00:00:00 2001 From: natsukium Date: Sun, 14 Jan 2024 15:56:02 +0900 Subject: [PATCH 4/4] python311Packages.langchain: 0.0.344 -> 0.1.0 Diff: https://github.com/hwchase17/langchain/compare/refs/tags/v0.0.344...v0.1.0 Changelog: https://github.com/hwchase17/langchain/releases/tag/v0.1.0 --- .../python-modules/langchain/default.nix | 132 +++--------------- 1 file changed, 16 insertions(+), 116 deletions(-) diff --git a/pkgs/development/python-modules/langchain/default.nix b/pkgs/development/python-modules/langchain/default.nix index 429689452a83..d39942c769ac 100644 --- a/pkgs/development/python-modules/langchain/default.nix +++ b/pkgs/development/python-modules/langchain/default.nix @@ -6,11 +6,12 @@ , pythonRelaxDepsHook , poetry-core , aiohttp -, anyio , async-timeout , dataclasses-json , jsonpatch , langsmith +, langchain-core +, langchain-community , numpy , pydantic , pyyaml @@ -18,60 +19,27 @@ , sqlalchemy , tenacity # optional dependencies -, atlassian-python-api , azure-core , azure-cosmos , azure-identity -, beautifulsoup4 , chardet , clarifai , cohere -, duckduckgo-search -, elasticsearch , esprima -, faiss -, google-api-python-client -, google-auth -, google-search-results -, gptcache -, html2text , huggingface-hub -, jinja2 -, jq , lark -, librosa -, lxml , manifest-ml -, neo4j -, networkx , nlpcloud -, nltk , openai -, opensearch-py -, pdfminer-six -, pgvector -, pinecone-client -, psycopg2 -, pymongo -, pyowm -, pypdf -, pytesseract -, python-arango , qdrant-client -, rdflib -, redis -, requests-toolbelt , sentence-transformers , tiktoken , torch , transformers , typer -, weaviate-client -, wikipedia # test dependencies , freezegun , pandas -, pexpect , pytest-asyncio , pytest-mock , pytest-socket @@ -84,16 +52,16 @@ buildPythonPackage rec { pname = "langchain"; - version = "0.0.344"; + version = "0.1.0"; pyproject = true; disabled = pythonOlder "3.8"; src = fetchFromGitHub { - owner = "hwchase17"; + owner = "langchain-ai"; repo = "langchain"; rev = "refs/tags/v${version}"; - hash = "sha256-pvoY2QuGTZhqeCi9oLOH1XrxfT4FMfHwNkIGIaYTEo8="; + hash = "sha256-izaSah1S0INsskdzE9b7Iw4yWBsNmN5fBI6BQgaHgE4="; }; sourceRoot = "${src.name}/libs/langchain"; @@ -108,17 +76,18 @@ buildPythonPackage rec { ]; propagatedBuildInputs = [ + langchain-core + langchain-community pydantic sqlalchemy requests pyyaml numpy - dataclasses-json - tenacity aiohttp - langsmith - anyio + tenacity jsonpatch + dataclasses-json + langsmith ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; @@ -169,81 +138,9 @@ buildPythonPackage rec { # azure-ai-vision # azure-cognitiveservices-speech # azure-search-documents + # azure-ai-textanalytics ]; all = [ - clarifai - cohere - openai - nlpcloud - huggingface-hub - manifest-ml - elasticsearch - opensearch-py - google-search-results - faiss - sentence-transformers - transformers - nltk - wikipedia - beautifulsoup4 - tiktoken - torch - jinja2 - pinecone-client - # pinecone-text - # marqo - pymongo - weaviate-client - redis - google-api-python-client - google-auth - # wolframalpha - qdrant-client - # tensorflow-text - pypdf - networkx - # nomic - # aleph-alpha-client - # deeplake - # libdeeplake - pgvector - psycopg2 - pyowm - pytesseract - html2text - atlassian-python-api - gptcache - duckduckgo-search - # arxiv - azure-identity - # clickhouse-connect - azure-cosmos - # lancedb - # langkit - lark - pexpect - # pyvespa - # O365 - jq - # docarray - pdfminer-six - lxml - requests-toolbelt - neo4j - # openlm - # azure-ai-formrecognizer - # azure-ai-vision - # azure-cognitiveservices-speech - # momento - # singlestoredb - # tigrisdb - # nebula3-python - # awadb - esprima - rdflib - # amadeus - librosa - python-arango ]; cli = [ typer @@ -277,6 +174,9 @@ buildPythonPackage rec { # these tests have network access "test_socket_disabled" + + # this test may require a specific version of langchain-community + "test_compatible_vectorstore_documentation" ]; pythonImportsCheck = [ @@ -285,8 +185,8 @@ buildPythonPackage rec { meta = with lib; { description = "Building applications with LLMs through composability"; - homepage = "https://github.com/hwchase17/langchain"; - changelog = "https://github.com/hwchase17/langchain/releases/tag/v${version}"; + homepage = "https://github.com/langchain-ai/langchain"; + changelog = "https://github.com/langchain-ai/langchain/releases/tag/v${version}"; license = licenses.mit; maintainers = with maintainers; [ natsukium ]; };