about 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.nix81
1 files changed, 12 insertions, 69 deletions
diff --git a/pkgs/development/python-modules/langchain/default.nix b/pkgs/development/python-modules/langchain/default.nix
index ddcb01d7c4506..91b7a54b1d0fe 100644
--- a/pkgs/development/python-modules/langchain/default.nix
+++ b/pkgs/development/python-modules/langchain/default.nix
@@ -2,29 +2,15 @@
   lib,
   aiohttp,
   async-timeout,
-  azure-core,
-  azure-cosmos,
-  azure-identity,
   bash,
   buildPythonPackage,
-  chardet,
-  clarifai,
-  cohere,
-  dataclasses-json,
-  esprima,
   fetchFromGitHub,
   freezegun,
-  huggingface-hub,
-  jsonpatch,
-  langchain-community,
   langchain-core,
   langchain-text-splitters,
   langsmith,
   lark,
-  manifest-ml,
-  nlpcloud,
   numpy,
-  openai,
   pandas,
   poetry-core,
   pydantic,
@@ -34,24 +20,18 @@
   pytestCheckHook,
   pythonOlder,
   pyyaml,
-  qdrant-client,
   requests-mock,
   requests,
   responses,
-  sentence-transformers,
   sqlalchemy,
   syrupy,
   tenacity,
-  tiktoken,
   toml,
-  torch,
-  transformers,
-  typer,
 }:
 
 buildPythonPackage rec {
   pname = "langchain";
-  version = "0.1.16";
+  version = "0.2.3";
   pyproject = true;
 
   disabled = pythonOlder "3.8";
@@ -59,8 +39,8 @@ buildPythonPackage rec {
   src = fetchFromGitHub {
     owner = "langchain-ai";
     repo = "langchain";
-    rev = "refs/tags/v${version}";
-    hash = "sha256-Xv8juma/1qGC2Rb659dJBvRzRh5W+zU+O8W6peElFGc=";
+    rev = "refs/tags/langchain==${version}";
+    hash = "sha256-9WrWQuZxtl/eBEDdgKCUqT7fYBl6gSsW9rB8tTBqMso=";
   };
 
   sourceRoot = "${src.name}/libs/langchain";
@@ -71,9 +51,6 @@ buildPythonPackage rec {
 
   dependencies = [
     aiohttp
-    dataclasses-json
-    jsonpatch
-    langchain-community
     langchain-core
     langchain-text-splitters
     langsmith
@@ -85,46 +62,6 @@ buildPythonPackage rec {
     tenacity
   ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ];
 
-  passthru.optional-dependencies = {
-    llms = [
-      clarifai
-      cohere
-      openai
-      # openlm
-      nlpcloud
-      huggingface-hub
-      manifest-ml
-      torch
-      transformers
-    ];
-    qdrant = [ qdrant-client ];
-    openai = [
-      openai
-      tiktoken
-    ];
-    text_helpers = [ chardet ];
-    clarifai = [ clarifai ];
-    cohere = [ cohere ];
-    docarray = [
-      # docarray
-    ];
-    embeddings = [ sentence-transformers ];
-    javascript = [ esprima ];
-    azure = [
-      azure-identity
-      azure-cosmos
-      openai
-      azure-core
-      # azure-ai-formrecognizer
-      # azure-ai-vision
-      # azure-cognitiveservices-speech
-      # azure-search-documents
-      # azure-ai-textanalytics
-    ];
-    all = [ ];
-    cli = [ typer ];
-  };
-
   nativeCheckInputs = [
     freezegun
     lark
@@ -160,16 +97,22 @@ buildPythonPackage rec {
     "test_generic_fake_chat_model"
     # Test is outdated
     "test_serializable_mapping"
+    "test_person"
+    "test_aliases_hidden"
   ];
 
   pythonImportsCheck = [ "langchain" ];
 
-  meta = with lib; {
+  passthru = {
+    updateScript = langchain-core.updateScript;
+  };
+
+  meta = {
     description = "Building applications with LLMs through composability";
     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 ];
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ natsukium ];
     mainProgram = "langchain-server";
   };
 }