Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at flake-libs 77 lines 1.6 kB view raw
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 nix-update-script, 21}: 22 23buildPythonPackage rec { 24 pname = "langchain-ollama"; 25 version = "0.3.3"; 26 pyproject = true; 27 28 src = fetchFromGitHub { 29 owner = "langchain-ai"; 30 repo = "langchain"; 31 tag = "langchain-ollama==${version}"; 32 hash = "sha256-YxcxVyiPEZPvO4NyeDp8nTVfbxlOCLClWCmAlL5PPi0="; 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 individul 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 pytestFlagsArray = [ "tests/unit_tests" ]; 60 61 pythonImportsCheck = [ "langchain_ollama" ]; 62 63 passthru.updateScript = nix-update-script { 64 extraArgs = [ 65 "--version-regex" 66 "langchain-ollama==([0-9.]+)" 67 ]; 68 }; 69 70 meta = { 71 changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-ollama==${version}"; 72 description = "Integration package connecting Ollama and LangChain"; 73 homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/ollama"; 74 license = lib.licenses.mit; 75 maintainers = with lib.maintainers; [ sarahec ]; 76 }; 77}