about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorOTABI Tomoya2024-09-21 13:05:44 +0900
committerGitHub2024-09-21 13:05:44 +0900
commit4921dbd75d2824d83bfc7b04fdac66c7b7b952fb (patch)
treef45fa30b4c710e7f4d8d1d20bbacb3c9f794e09f /pkgs
parentab45bcebd9031e0c5cd52310f8ed0be69183f329 (diff)
parent33d7c2226c833e136e1143c87f08c0b2a9b36318 (diff)
python312Packages.langchain-ollama: init at 0.2.0 (#343125)
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/langchain-ollama/default.nix68
-rw-r--r--pkgs/top-level/python-packages.nix2
2 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/langchain-ollama/default.nix b/pkgs/development/python-modules/langchain-ollama/default.nix
new file mode 100644
index 000000000000..72bcf180d414
--- /dev/null
+++ b/pkgs/development/python-modules/langchain-ollama/default.nix
@@ -0,0 +1,68 @@
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+
+  # build-system
+  poetry-core,
+
+  # dependencies
+  langchain-core,
+  ollama,
+
+  # testing
+  langchain-standard-tests,
+  pytestCheckHook,
+  pytest-asyncio,
+  syrupy,
+
+  nix-update-script,
+}:
+
+buildPythonPackage rec {
+  pname = "langchain-ollama";
+  version = "0.2.0";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "langchain-ai";
+    repo = "langchain";
+    rev = "refs/tags/langchain-ollama==${version}";
+    hash = "sha256-NtlJqIevdaoOO4oDqKsL4OFbw8tHb3FjV9LrTytOGKE=";
+  };
+
+  sourceRoot = "${src.name}/libs/partners/ollama";
+
+  build-system = [ poetry-core ];
+
+  dependencies = [
+    langchain-core
+    ollama
+  ];
+
+  nativeCheckInputs = [
+    langchain-standard-tests
+    pytestCheckHook
+    pytest-asyncio
+    syrupy
+  ];
+
+  pytestFlagsArray = [ "tests/unit_tests" ];
+
+  pythonImportsCheck = [ "langchain_ollama" ];
+
+  passthru.updateScript = nix-update-script {
+    extraArgs = [
+      "--version-regex"
+      "langchain-ollama==(.*)"
+    ];
+  };
+
+  meta = {
+    changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-ollama==${version}";
+    description = "Integration package connecting Ollama and LangChain";
+    homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/ollama";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ sarahec ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 74cb990650ae..d2444a80a387 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -6825,6 +6825,8 @@ self: super: with self; {
 
   langchain-mongodb = callPackage ../development/python-modules/langchain-mongodb { };
 
+  langchain-ollama = callPackage ../development/python-modules/langchain-ollama { };
+
   langchain-openai = callPackage ../development/python-modules/langchain-openai { };
 
   langchain-standard-tests = callPackage ../development/python-modules/langchain-standard-tests { };