1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 llm,
7 llm-grok,
8 httpx,
9 httpx-sse,
10 rich,
11 pytestCheckHook,
12 pytest-httpx,
13 writableTmpDirAsHomeHook,
14}:
15
16buildPythonPackage rec {
17 pname = "llm-grok";
18 version = "1.3.0";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "Hiepler";
23 repo = "llm-grok";
24 tag = "v${version}";
25 hash = "sha256-Z/q7A7lidtDPpuD+xnD7+puWxvUZi4ruO7l1AZEu1vU=";
26 };
27
28 build-system = [ setuptools ];
29
30 dependencies = [
31 llm
32 httpx
33 httpx-sse
34 rich
35 ];
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 pytest-httpx
40 writableTmpDirAsHomeHook
41 ];
42
43 pythonImportsCheck = [ "llm_grok" ];
44
45 passthru.tests = llm.mkPluginTest llm-grok;
46
47 meta = {
48 description = "LLM plugin providing access to Grok models using the xAI API";
49 homepage = "https://github.com/Hiepler/llm-grok";
50 changelog = "https://github.com/Hiepler/llm-grok/releases/tag/${src.tag}/CHANGELOG.md";
51 license = lib.licenses.asl20;
52 maintainers = with lib.maintainers; [ philiptaron ];
53 };
54}