summary refs log tree commit diff
path: root/pkgs/development/python-modules/langchain/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/langchain/default.nix')
-rw-r--r--pkgs/development/python-modules/langchain/default.nix56
1 files changed, 24 insertions, 32 deletions
diff --git a/pkgs/development/python-modules/langchain/default.nix b/pkgs/development/python-modules/langchain/default.nix
index 865ce51b07d..c2fabc40c03 100644
--- a/pkgs/development/python-modules/langchain/default.nix
+++ b/pkgs/development/python-modules/langchain/default.nix
@@ -6,19 +6,18 @@
 , pythonRelaxDepsHook
 , poetry-core
 , aiohttp
+, anyio
 , async-timeout
 , dataclasses-json
+, jsonpatch
 , langsmith
-, numexpr
 , numpy
-, openapi-schema-pydantic
 , pydantic
 , pyyaml
 , requests
 , sqlalchemy
 , tenacity
   # optional dependencies
-, anthropic
 , atlassian-python-api
 , azure-core
 , azure-cosmos
@@ -43,7 +42,6 @@
 , librosa
 , lxml
 , manifest-ml
-, markdownify
 , neo4j
 , networkx
 , nlpcloud
@@ -54,6 +52,7 @@
 , pgvector
 , pinecone-client
 , psycopg2
+, pymongo
 , pyowm
 , pypdf
 , pytesseract
@@ -63,11 +62,10 @@
 , redis
 , requests-toolbelt
 , sentence-transformers
-, spacy
-, steamship
 , tiktoken
 , torch
 , transformers
+, typer
 , weaviate-client
 , wikipedia
   # test dependencies
@@ -77,8 +75,8 @@
 , pytest-asyncio
 , pytest-mock
 , pytest-socket
-, pytest-vcr
 , pytestCheckHook
+, requests-mock
 , responses
 , syrupy
 , toml
@@ -86,8 +84,8 @@
 
 buildPythonPackage rec {
   pname = "langchain";
-  version = "0.0.285";
-  format = "pyproject";
+  version = "0.0.334";
+  pyproject = true;
 
   disabled = pythonOlder "3.8";
 
@@ -95,18 +93,11 @@ buildPythonPackage rec {
     owner = "hwchase17";
     repo = "langchain";
     rev = "refs/tags/v${version}";
-    hash = "sha256-3vOfwn8qvPd9dPRnsX14bVSLQQKHLPS5r15S8yAQFpw=";
+    hash = "sha256-mXPqc8wF9DhEtITm8h5R9kHBcMJ7AEK4kL5Z7V2p8NE=";
   };
 
   sourceRoot = "${src.name}/libs/langchain";
 
-  postPatch = ''
-    substituteInPlace langchain/utilities/bash.py \
-      --replace '"env", ["-i", "bash", ' '"${lib.getExe bash}", ['
-    substituteInPlace tests/unit_tests/test_bash.py \
-      --replace "/bin/sh" "${bash}/bin/sh"
-  '';
-
   nativeBuildInputs = [
     poetry-core
     pythonRelaxDepsHook
@@ -122,30 +113,27 @@ buildPythonPackage rec {
     requests
     pyyaml
     numpy
-    openapi-schema-pydantic
     dataclasses-json
     tenacity
     aiohttp
-    numexpr
     langsmith
+    anyio
+    jsonpatch
   ] ++ lib.optionals (pythonOlder "3.11") [
     async-timeout
   ];
 
   passthru.optional-dependencies = {
     llms = [
-      anthropic
       clarifai
       cohere
       openai
-      # openllm
       # openlm
       nlpcloud
       huggingface-hub
       manifest-ml
       torch
       transformers
-      # xinference
     ];
     qdrant = [
       qdrant-client
@@ -183,13 +171,11 @@ buildPythonPackage rec {
       # azure-search-documents
     ];
     all = [
-      anthropic
       clarifai
       cohere
       openai
       nlpcloud
       huggingface-hub
-      # jina
       manifest-ml
       elasticsearch
       opensearch-py
@@ -197,7 +183,6 @@ buildPythonPackage rec {
       faiss
       sentence-transformers
       transformers
-      spacy
       nltk
       wikipedia
       beautifulsoup4
@@ -206,6 +191,8 @@ buildPythonPackage rec {
       jinja2
       pinecone-client
       # pinecone-text
+      # marqo
+      pymongo
       weaviate-client
       redis
       google-api-python-client
@@ -239,7 +226,6 @@ buildPythonPackage rec {
       # O365
       jq
       # docarray
-      steamship
       pdfminer-six
       lxml
       requests-toolbelt
@@ -253,33 +239,35 @@ buildPythonPackage rec {
       # tigrisdb
       # nebula3-python
       # awadb
-      # esprima
-      # octoai-sdk
+      esprima
       rdflib
       # amadeus
-      # xinference
       librosa
       python-arango
     ];
+    cli = [
+      typer
+    ];
   };
 
   nativeCheckInputs = [
     freezegun
-    markdownify
+    lark
     pandas
     pytest-asyncio
     pytest-mock
     pytest-socket
-    pytest-vcr
     pytestCheckHook
+    requests-mock
     responses
     syrupy
     toml
-  ] ++ passthru.optional-dependencies.all;
+  ];
 
   pytestFlagsArray = [
     # integration_tests have many network, db access and require `OPENAI_API_KEY`, etc.
     "tests/unit_tests"
+    "--only-core"
   ];
 
   disabledTests = [
@@ -291,6 +279,10 @@ buildPythonPackage rec {
     "test_socket_disabled"
   ];
 
+  pythonImportsCheck = [
+    "langchain"
+  ];
+
   meta = with lib; {
     description = "Building applications with LLMs through composability";
     homepage = "https://github.com/hwchase17/langchain";