Skip to content

Commit 4921dbd

Browse files
authored
python312Packages.langchain-ollama: init at 0.2.0 (#343125)
2 parents ab45bce + 33d7c22 commit 4921dbd

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchFromGitHub,
5+
6+
# build-system
7+
poetry-core,
8+
9+
# dependencies
10+
langchain-core,
11+
ollama,
12+
13+
# testing
14+
langchain-standard-tests,
15+
pytestCheckHook,
16+
pytest-asyncio,
17+
syrupy,
18+
19+
nix-update-script,
20+
}:
21+
22+
buildPythonPackage rec {
23+
pname = "langchain-ollama";
24+
version = "0.2.0";
25+
pyproject = true;
26+
27+
src = fetchFromGitHub {
28+
owner = "langchain-ai";
29+
repo = "langchain";
30+
rev = "refs/tags/langchain-ollama==${version}";
31+
hash = "sha256-NtlJqIevdaoOO4oDqKsL4OFbw8tHb3FjV9LrTytOGKE=";
32+
};
33+
34+
sourceRoot = "${src.name}/libs/partners/ollama";
35+
36+
build-system = [ poetry-core ];
37+
38+
dependencies = [
39+
langchain-core
40+
ollama
41+
];
42+
43+
nativeCheckInputs = [
44+
langchain-standard-tests
45+
pytestCheckHook
46+
pytest-asyncio
47+
syrupy
48+
];
49+
50+
pytestFlagsArray = [ "tests/unit_tests" ];
51+
52+
pythonImportsCheck = [ "langchain_ollama" ];
53+
54+
passthru.updateScript = nix-update-script {
55+
extraArgs = [
56+
"--version-regex"
57+
"langchain-ollama==(.*)"
58+
];
59+
};
60+
61+
meta = {
62+
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-ollama==${version}";
63+
description = "Integration package connecting Ollama and LangChain";
64+
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/ollama";
65+
license = lib.licenses.mit;
66+
maintainers = with lib.maintainers; [ sarahec ];
67+
};
68+
}

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6825,6 +6825,8 @@ self: super: with self; {
68256825

68266826
langchain-mongodb = callPackage ../development/python-modules/langchain-mongodb { };
68276827

6828+
langchain-ollama = callPackage ../development/python-modules/langchain-ollama { };
6829+
68286830
langchain-openai = callPackage ../development/python-modules/langchain-openai { };
68296831

68306832
langchain-standard-tests = callPackage ../development/python-modules/langchain-standard-tests { };

0 commit comments

Comments
 (0)