1{
2 lib,
3 callPackage,
4 buildPythonPackage,
5 fetchFromGitHub,
6 setuptools,
7 llm,
8 anthropic,
9 pytestCheckHook,
10 pytest-asyncio,
11 pytest-recording,
12 writableTmpDirAsHomeHook,
13}:
14
15buildPythonPackage rec {
16 pname = "llm-anthropic";
17 version = "0.15.1";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "simonw";
22 repo = "llm-anthropic";
23 tag = version;
24 hash = "sha256-8bVs3MJteOTCiw7n/4pMf+oXMhsQbCSzUFVQqm2ezcE=";
25 };
26
27 build-system = [
28 setuptools
29 llm
30 ];
31 dependencies = [ anthropic ];
32
33 nativeCheckInputs = [
34 pytestCheckHook
35 pytest-asyncio
36 pytest-recording
37 writableTmpDirAsHomeHook
38 ];
39
40 pythonImportsCheck = [ "llm_anthropic" ];
41
42 passthru.tests = {
43 llm-plugin = callPackage ./tests/llm-plugin.nix { };
44 };
45
46 meta = {
47 description = "LLM access to models by Anthropic, including the Claude series";
48 homepage = "https://github.com/simonw/llm-anthropic";
49 changelog = "https://github.com/simonw/llm-anthropic/releases/tag/${version}/CHANGELOG.md";
50 license = lib.licenses.asl20;
51 maintainers = with lib.maintainers; [ aos ];
52 };
53}