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