1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 nix-update-script, 6 7 # build-system 8 pdm-backend, 9 10 # dependencies 11 langchain-core, 12 groq, 13 14 # tests 15 langchain-tests, 16 pytestCheckHook, 17}: 18 19buildPythonPackage rec { 20 pname = "langchain-groq"; 21 version = "0.3.2"; 22 pyproject = true; 23 24 src = fetchFromGitHub { 25 owner = "langchain-ai"; 26 repo = "langchain"; 27 tag = "langchain-groq==${version}"; 28 hash = "sha256-KsKT7+jpTTiSVMZWcIwW7+1BCL7rpZHg/OX3PNLI6As="; 29 }; 30 31 sourceRoot = "${src.name}/libs/partners/groq"; 32 33 build-system = [ pdm-backend ]; 34 35 pythonRelaxDeps = [ 36 # Each component release requests the exact latest core. 37 # That prevents us from updating individul components. 38 "langchain-core" 39 ]; 40 41 dependencies = [ 42 langchain-core 43 groq 44 ]; 45 46 nativeCheckInputs = [ 47 langchain-tests 48 pytestCheckHook 49 ]; 50 51 pytestFlagsArray = [ "tests/unit_tests" ]; 52 53 pythonImportsCheck = [ "langchain_groq" ]; 54 55 passthru.updateScript = nix-update-script { 56 extraArgs = [ 57 "--version-regex" 58 "^langchain-groq==([0-9.]+)$" 59 ]; 60 }; 61 62 meta = { 63 changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-groq==${version}"; 64 description = "Integration package connecting Groq and LangChain"; 65 homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/groq"; 66 license = lib.licenses.mit; 67 maintainers = with lib.maintainers; [ 68 sarahec 69 ]; 70 }; 71}