summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/llm-perplexity/default.nix
blob: 1fd3067f50b2678e7823382914cbe128cb80c6bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,

  # dependencies
  llm,
  openai,

  # tests
  pytestCheckHook,
  writableTmpDirAsHomeHook,
  python-dotenv,
  pillow,
  llm-perplexity,
}:
buildPythonPackage rec {
  pname = "llm-perplexity";
  version = "2025.12.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "hex";
    repo = "llm-perplexity";
    tag = version;
    hash = "sha256-jPSYwhEGph/1C9n/fv1nZurY4Inu/XNHYSE1r86N1Kw=";
  };

  build-system = [ setuptools ];

  dependencies = [
    llm
    openai
  ];

  nativeCheckInputs = [
    pytestCheckHook
    writableTmpDirAsHomeHook
    python-dotenv
    pillow
  ];

  pythonImportsCheck = [ "llm_perplexity" ];

  passthru.tests = llm.mkPluginTest llm-perplexity;

  meta = {
    description = "LLM access to pplx-api";
    homepage = "https://github.com/hex/llm-perplexity";
    changelog = "https://github.com/hex/llm-perplexity/releases/tag/${version}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ jed-richards ];
  };
}