1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 pdm-backend,
8
9 # dependencies
10 langchain-core,
11 ollama,
12
13 # testing
14 langchain-tests,
15 pytestCheckHook,
16 pytest-asyncio,
17 syrupy,
18
19 # passthru
20 gitUpdater,
21}:
22
23buildPythonPackage rec {
24 pname = "langchain-ollama";
25 version = "0.3.8";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "langchain-ai";
30 repo = "langchain";
31 tag = "langchain-ollama==${version}";
32 hash = "sha256-r6O06JHJOtMPA/FOmkr6YCT5pUnlcG9wu2Bm3Gae5Mk=";
33 };
34
35 sourceRoot = "${src.name}/libs/partners/ollama";
36
37 build-system = [
38 pdm-backend
39 ];
40
41 pythonRelaxDeps = [
42 # Each component release requests the exact latest core.
43 # That prevents us from updating individual components.
44 "langchain-core"
45 ];
46
47 dependencies = [
48 langchain-core
49 ollama
50 ];
51
52 nativeCheckInputs = [
53 langchain-tests
54 pytestCheckHook
55 pytest-asyncio
56 syrupy
57 ];
58
59 enabledTestPaths = [ "tests/unit_tests" ];
60
61 pythonImportsCheck = [ "langchain_ollama" ];
62
63 passthru = {
64 # python updater script sets the wrong tag
65 skipBulkUpdate = true;
66 updateScript = gitUpdater {
67 rev-prefix = "langchain-ollama==";
68 };
69 };
70
71 meta = {
72 changelog = "https://github.com/langchain-ai/langchain/releases/tag/${src.tag}";
73 description = "Integration package connecting Ollama and LangChain";
74 homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/ollama";
75 license = lib.licenses.mit;
76 maintainers = with lib.maintainers; [ sarahec ];
77 };
78}