about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorFabian Affolter <fabian@affolter-engineering.ch>2024-05-01 16:13:52 +0200
committerGitHub <noreply@github.com>2024-05-01 16:13:52 +0200
commit274b5189a07c959329d18c1205eafea1ba5df0f1 (patch)
tree3ef32450fedf315cdb60dd08e43079785a010e15 /pkgs
parent3e49b0ba0833f534fca9be19916895c0562db628 (diff)
parent8d2927a9dcf0a0ce32b99f949d888d55ace1f9c3 (diff)
Merge pull request #307684 from fabaff/langchain-bump
python312Packages.langchain-community: 0.0.33 -> 0.0.34, python312Packages.anthropic: 0.19.1 -> 0.25.6, python312Packages.langsmith: 0.1.48 -> 0.1.51, python312Packages.instructor: 0.6.8 -> 1.2.3
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/by-name/sh/shell-gpt/package.nix51
-rw-r--r--pkgs/development/python-modules/anthropic/default.nix59
-rw-r--r--pkgs/development/python-modules/instructor/default.nix71
-rw-r--r--pkgs/development/python-modules/langchain-community/default.nix4
-rw-r--r--pkgs/development/python-modules/langchain/default.nix2
-rw-r--r--pkgs/development/python-modules/langsmith/default.nix9
-rw-r--r--pkgs/tools/llm/shell_gpt/default.nix48
-rw-r--r--pkgs/top-level/all-packages.nix2
8 files changed, 157 insertions, 89 deletions
diff --git a/pkgs/by-name/sh/shell-gpt/package.nix b/pkgs/by-name/sh/shell-gpt/package.nix
new file mode 100644
index 0000000000000..92f451b24088f
--- /dev/null
+++ b/pkgs/by-name/sh/shell-gpt/package.nix
@@ -0,0 +1,51 @@
+{
+  lib,
+  fetchFromGitHub,
+  python3,
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "shell-gpt";
+  version = "1.4.3";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "TheR1D";
+    repo = "shell_gpt";
+    rev = "refs/tags/${version}";
+    hash = "sha256-T37L4U1kOrrIQJ2znq2UupD3pyit9xd8rAsEwUvGiQ8=";
+  };
+
+  pythonRelaxDeps = [
+    "requests"
+    "rich"
+    "distro"
+    "typer"
+    "instructor"
+  ];
+
+  build-system = with python3.pkgs; [ hatchling ];
+
+  nativeBuildInputs = with python3.pkgs; [ pythonRelaxDepsHook ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    click
+    distro
+    instructor
+    openai
+    rich
+    typer
+  ];
+
+  # Tests want to read the OpenAI API key from stdin
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Access ChatGPT from your terminal";
+    homepage = "https://github.com/TheR1D/shell_gpt";
+    changelog = "https://github.com/TheR1D/shell_gpt/releases/tag/${version}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ mglolenstine ];
+    mainProgram = "sgpt";
+  };
+}
diff --git a/pkgs/development/python-modules/anthropic/default.nix b/pkgs/development/python-modules/anthropic/default.nix
index 76b852c71f6dc..5eef6a51010a4 100644
--- a/pkgs/development/python-modules/anthropic/default.nix
+++ b/pkgs/development/python-modules/anthropic/default.nix
@@ -1,25 +1,27 @@
-{ lib
-, buildPythonPackage
-, fetchFromGitHub
-, hatchling
-, anyio
-, distro
-, dirty-equals
-, httpx
-, google-auth
-, sniffio
-, pydantic
-, pytest-asyncio
-, respx
-, tokenizers
-, typing-extensions
-, pytestCheckHook
-, pythonOlder
+{
+  lib,
+  anyio,
+  buildPythonPackage,
+  dirty-equals,
+  distro,
+  fetchFromGitHub,
+  google-auth,
+  hatch-fancy-pypi-readme,
+  hatchling,
+  httpx,
+  pydantic,
+  pytest-asyncio,
+  pytestCheckHook,
+  pythonOlder,
+  respx,
+  sniffio,
+  tokenizers,
+  typing-extensions,
 }:
 
 buildPythonPackage rec {
   pname = "anthropic";
-  version = "0.19.1";
+  version = "0.25.6";
   pyproject = true;
 
   disabled = pythonOlder "3.8";
@@ -28,14 +30,15 @@ buildPythonPackage rec {
     owner = "anthropics";
     repo = "anthropic-sdk-python";
     rev = "refs/tags/v${version}";
-    hash = "sha256-D9asbwZ9puOuIK6w7cWJ2HmC3JYjamUZPOxVKWq+Va4=";
+    hash = "sha256-83TufOgu6W9UvoCEUgDiw6gXDAdwyIKEALVF0hjj6wk=";
   };
 
-  nativeBuildInputs = [
+  build-system = [
     hatchling
+    hatch-fancy-pypi-readme
   ];
 
-  propagatedBuildInputs = [
+  dependencies = [
     anyio
     distro
     httpx
@@ -56,13 +59,21 @@ buildPythonPackage rec {
     respx
   ];
 
+  pythonImportsCheck = [ "anthropic" ];
+
+  disabledTests = [
+    # Test require network access
+    "test_copy_build_request"
+  ];
+
   disabledTestPaths = [
-    # require network access
+    # Test require network access
     "tests/api_resources"
   ];
 
-  pythonImportsCheck = [
-    "anthropic"
+  pytestFlagsArray = [
+    "-W"
+    "ignore::DeprecationWarning"
   ];
 
   meta = with lib; {
diff --git a/pkgs/development/python-modules/instructor/default.nix b/pkgs/development/python-modules/instructor/default.nix
index 0370c356d9fcc..bb36e7a8abf21 100644
--- a/pkgs/development/python-modules/instructor/default.nix
+++ b/pkgs/development/python-modules/instructor/default.nix
@@ -1,24 +1,50 @@
-{ lib
-, python3
-, fetchPypi
-, buildPythonPackage
+{
+  lib,
+  aiohttp,
+  anthropic,
+  buildPythonPackage,
+  docstring-parser,
+  fetchFromGitHub,
+  openai,
+  poetry-core,
+  pydantic,
+  pytest-examples,
+  pytest-asyncio,
+  pytestCheckHook,
+  fastapi,
+  diskcache,
+  redis,
+  pythonOlder,
+  pythonRelaxDepsHook,
+  rich,
+  tenacity,
+  typer,
 }:
 
 buildPythonPackage rec {
   pname = "instructor";
-  version = "0.6.8";
+  version = "1.2.3";
   pyproject = true;
 
-  src = fetchPypi {
-    inherit pname version;
-    hash = "sha256-4mHXPes1NdYu53XEN7gq626cKy9ju1M7U6n6akfbuVo=";
+  disabled = pythonOlder "3.9";
+
+  src = fetchFromGitHub {
+    owner = "jxnl";
+    repo = "instructor";
+    rev = "refs/tags/${version}";
+    hash = "sha256-LmorlFKIG7iPAK4pDbQqjxjiwB1md3u52B4u5WlqqTk=";
   };
 
-  nativeBuildInputs = [
-    python3.pkgs.poetry-core
+  pythonRelaxDeps = [
+    "docstring-parser"
+    "pydantic"
   ];
 
-  propagatedBuildInputs = with python3.pkgs; [
+  build-system = [ poetry-core ];
+
+  nativeBuildInputs = [ pythonRelaxDepsHook ];
+
+  dependencies = [
     aiohttp
     docstring-parser
     openai
@@ -28,8 +54,31 @@ buildPythonPackage rec {
     typer
   ];
 
+  nativeCheckInputs = [
+    anthropic
+    fastapi
+    redis
+    diskcache
+    pytest-asyncio
+    pytest-examples
+    pytestCheckHook
+  ];
+
   pythonImportsCheck = [ "instructor" ];
 
+  disabledTests = [
+    # Tests require OpenAI API key
+    "test_partial"
+    "successfully"
+  ];
+
+  disabledTestPaths = [
+    # Tests require OpenAI API key
+    "tests/test_distil.py"
+    "tests/test_new_client.py"
+    "tests/llm/"
+  ];
+
   meta = with lib; {
     description = "Structured outputs for llm";
     homepage = "https://github.com/jxnl/instructor";
diff --git a/pkgs/development/python-modules/langchain-community/default.nix b/pkgs/development/python-modules/langchain-community/default.nix
index 472022947fed5..452f79f7794d9 100644
--- a/pkgs/development/python-modules/langchain-community/default.nix
+++ b/pkgs/development/python-modules/langchain-community/default.nix
@@ -18,7 +18,7 @@
 
 buildPythonPackage rec {
   pname = "langchain-community";
-  version = "0.0.33";
+  version = "0.0.34";
   pyproject = true;
 
   disabled = pythonOlder "3.8";
@@ -26,7 +26,7 @@ buildPythonPackage rec {
   src = fetchPypi {
     pname = "langchain_community";
     inherit version;
-    hash = "sha256-u1bbwe8RygnyWEaOETaHga3akhnhRAc+MM2mlJbTQrI=";
+    hash = "sha256-lumoB9m0d3gg31qXCZb2vzrVYyE3vw9NhjvYMr3rKw8=";
   };
 
   build-system = [ poetry-core ];
diff --git a/pkgs/development/python-modules/langchain/default.nix b/pkgs/development/python-modules/langchain/default.nix
index 48c2c0db93a1b..ddcb01d7c4506 100644
--- a/pkgs/development/python-modules/langchain/default.nix
+++ b/pkgs/development/python-modules/langchain/default.nix
@@ -158,6 +158,8 @@ buildPythonPackage rec {
     # AssertionErrors
     "test_callback_handlers"
     "test_generic_fake_chat_model"
+    # Test is outdated
+    "test_serializable_mapping"
   ];
 
   pythonImportsCheck = [ "langchain" ];
diff --git a/pkgs/development/python-modules/langsmith/default.nix b/pkgs/development/python-modules/langsmith/default.nix
index d77c613384754..32330e496a6ff 100644
--- a/pkgs/development/python-modules/langsmith/default.nix
+++ b/pkgs/development/python-modules/langsmith/default.nix
@@ -1,12 +1,14 @@
 {
   lib,
   stdenv,
+  anthropic,
   attr,
   buildPythonPackage,
   fastapi,
   fetchFromGitHub,
   freezegun,
   httpx,
+  instructor,
   orjson,
   poetry-core,
   pydantic,
@@ -20,7 +22,7 @@
 
 buildPythonPackage rec {
   pname = "langsmith";
-  version = "0.1.48";
+  version = "0.1.51";
   pyproject = true;
 
   disabled = pythonOlder "3.8";
@@ -29,7 +31,7 @@ buildPythonPackage rec {
     owner = "langchain-ai";
     repo = "langsmith-sdk";
     rev = "refs/tags/v${version}";
-    hash = "sha256-n24rlulncJHNyHFqszEbALGfnT7+tTGjLjwR7Fw1smI=";
+    hash = "sha256-31DC5SqI2V7d3iC5LlZgU5xB0Lh6GrBFFF3A+HEbUKg=";
   };
 
   sourceRoot = "${src.name}/python";
@@ -48,9 +50,11 @@ buildPythonPackage rec {
   ];
 
   nativeCheckInputs = [
+    anthropic
     fastapi
     freezegun
     httpx
+    instructor
     pytest-asyncio
     pytestCheckHook
     uvicorn
@@ -81,6 +85,7 @@ buildPythonPackage rec {
     "tests/unit_tests/test_client.py"
     # Tests require a Langsmith API key
     "tests/evaluation/test_evaluation.py"
+    "tests/external/test_instructor_evals.py"
   ];
 
   pythonImportsCheck = [ "langsmith" ];
diff --git a/pkgs/tools/llm/shell_gpt/default.nix b/pkgs/tools/llm/shell_gpt/default.nix
deleted file mode 100644
index 4db72ae505864..0000000000000
--- a/pkgs/tools/llm/shell_gpt/default.nix
+++ /dev/null
@@ -1,48 +0,0 @@
-{ lib
-, python3
-, fetchPypi
-, nix-update-script
-}:
-
-python3.pkgs.buildPythonApplication rec {
-  pname = "shell_gpt";
-  version = "1.4.3";
-  pyproject = true;
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "sha256-zSgWSC60ypOQ1IENcxObBezAfHosQWBD9ft06yh5iV4=";
-  };
-
-  nativeBuildInputs = with python3.pkgs; [
-    python3.pkgs.pythonRelaxDepsHook
-    python3
-    pip
-  ];
-
-  propagatedBuildInputs = with python3.pkgs; [
-    markdown-it-py
-    rich
-    distro
-    typer
-    requests
-    hatchling
-    openai
-    instructor
-  ];
-
-  pythonRelaxDeps = [ "requests" "rich" "distro" "typer" ];
-
-  passthru.updateScript = nix-update-script { };
-
-  doCheck = false;
-
-  meta = with lib; {
-    mainProgram = "sgpt";
-    homepage = "https://github.com/TheR1D/shell_gpt";
-    description = "Access ChatGPT from your terminal";
-    platforms = platforms.unix;
-    license = licenses.mit;
-    maintainers = with maintainers; [ mglolenstine ];
-  };
-}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 5c97ea86188ba..c164e5b218179 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -34417,8 +34417,6 @@ with pkgs;
 
   shavee = callPackage ../applications/misc/shavee { };
 
-  shell_gpt = callPackage ../tools/llm/shell_gpt { };
-
   shfmt = callPackage ../tools/text/shfmt { };
 
   shipments = callPackage ../applications/misc/shipments { };