From 5103cdf48b725b5a45d5905c76ac6ed2cbbf2b56 Mon Sep 17 00:00:00 2001 From: natsukium Date: Sun, 23 Jul 2023 21:43:19 +0900 Subject: [PATCH 1/2] python310Packages.langsmith: init at 0.0.14 --- .../python-modules/langsmith/default.nix | 54 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 56 insertions(+) create mode 100644 pkgs/development/python-modules/langsmith/default.nix diff --git a/pkgs/development/python-modules/langsmith/default.nix b/pkgs/development/python-modules/langsmith/default.nix new file mode 100644 index 000000000000..af1a1c1afeac --- /dev/null +++ b/pkgs/development/python-modules/langsmith/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pydantic +, requests +, pytestCheckHook +, pytest-asyncio +}: + +buildPythonPackage { + pname = "langsmith"; + version = "0.0.14"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "langchain-ai"; + repo = "langchainplus-sdk"; + # there are no correct tags + # https://github.com/langchain-ai/langchainplus-sdk/issues/105 + rev = "092f67222e4beabca0f51ba03f1ee028f916da63"; + hash = "sha256-U8fs16Uq80EB7Ey5YuQhUKKI9DOXJWlabM5JdoDnWP0="; + }; + + sourceRoot = "source/python"; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + pydantic + requests + ]; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + disabledTests = [ + # these tests require network access + "integration_tests" + ]; + + pythonImportsCheck = [ "langsmith" ]; + + meta = with lib; { + description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform"; + homepage = "https://github.com/langchain-ai/langchainplus-sdk"; + license = licenses.mit; + maintainers = with maintainers; [ natsukium ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3fcb689e1474..dfef356b4e6a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5678,6 +5678,8 @@ self: super: with self; { langdetect = callPackage ../development/python-modules/langdetect { }; + langsmith = callPackage ../development/python-modules/langsmith { }; + language-data = callPackage ../development/python-modules/language-data { }; language-tags = callPackage ../development/python-modules/language-tags { }; From 159ad4ca18a548af74c6a13315408c6b0b4a19fd Mon Sep 17 00:00:00 2001 From: natsukium Date: Sun, 23 Jul 2023 21:49:04 +0900 Subject: [PATCH 2/2] python310Packages.langchain: 0.0.229 -> 0.0.240 Diff: https://github.com/hwchase17/langchain/compare/refs/tags/v0.0.229...v0.0.240 Changelog: https://github.com/hwchase17/langchain/releases/tag/v0.0.240 --- pkgs/development/python-modules/langchain/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/langchain/default.nix b/pkgs/development/python-modules/langchain/default.nix index 707ce63ff38e..8b537122e439 100644 --- a/pkgs/development/python-modules/langchain/default.nix +++ b/pkgs/development/python-modules/langchain/default.nix @@ -62,7 +62,7 @@ , chardet , requests-toolbelt , neo4j -, langchainplus-sdk +, langsmith # test dependencies , pytest-vcr , pytest-asyncio @@ -80,7 +80,7 @@ buildPythonPackage rec { pname = "langchain"; - version = "0.0.229"; + version = "0.0.240"; format = "pyproject"; disabled = pythonOlder "3.8"; @@ -89,9 +89,11 @@ buildPythonPackage rec { owner = "hwchase17"; repo = "langchain"; rev = "refs/tags/v${version}"; - hash = "sha256-9hPF+0bEcFGH2oop3e513kBp6UeUEBlPXD+2pZ4dCi0="; + hash = "sha256-7UwAdOzEgu3K/Gfq8D/GHNGxD6KhSx0xGMxtmpdnYxQ="; }; + sourceRoot = "source/libs/langchain"; + postPatch = '' substituteInPlace langchain/utilities/bash.py \ --replace '"env", ["-i", "bash", ' '"${lib.getExe bash}", [' @@ -227,7 +229,7 @@ buildPythonPackage rec { # azure-ai-formrecognizer # azure-ai-vision # azure-cognitiveservices-speech - langchainplus-sdk + langsmith ]; };