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