1{
2 lib,
3 callPackage,
4 buildPythonPackage,
5 fetchFromGitHub,
6 setuptools,
7 llm,
8 openai,
9 pytestCheckHook,
10 pytest-asyncio,
11 pytest-recording,
12 syrupy,
13 cogapp,
14 writableTmpDirAsHomeHook,
15}:
16buildPythonPackage rec {
17 pname = "llm-openai-plugin";
18 version = "0.3";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "simonw";
23 repo = "llm-openai-plugin";
24 tag = version;
25 hash = "sha256-WpaxXJQXz9vkqtlQbi4NxLnX5j4UDLdQXwCEhDwkvm4=";
26 };
27
28 build-system = [
29 setuptools
30 ];
31
32 dependencies = [
33 llm
34 openai
35 ];
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 pytest-asyncio
40 pytest-recording
41 syrupy
42 cogapp
43 writableTmpDirAsHomeHook
44 ];
45
46 pythonImportsCheck = [ "llm_openai" ];
47
48 passthru.tests = {
49 llm-plugin = callPackage ./tests/llm-plugin.nix { };
50 };
51
52 meta = {
53 description = "OpenAI plugin for LLM";
54 homepage = "https://github.com/simonw/llm-openai-plugin";
55 changelog = "https://github.com/simonw/llm-openai-plugin/releases/tag/${src.tag}";
56 license = lib.licenses.asl20;
57 maintainers = with lib.maintainers; [ josh ];
58 };
59}