1{
2 lib,
3 buildPythonPackage,
4 cacert,
5 deprecated,
6 eval-type-backport,
7 fetchFromGitHub,
8 griffe,
9 hatchling,
10 jinja2,
11 litellm,
12 platformdirs,
13 pydantic,
14 pytest-asyncio,
15 pytestCheckHook,
16 redis,
17}:
18
19buildPythonPackage rec {
20 pname = "banks";
21 version = "2.2.0";
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "masci";
26 repo = "banks";
27 tag = "v${version}";
28 hash = "sha256-lzU1SwgZ7EKCmpDtCp4jKDBIdZVB+S1s/Oh3GfZCmtg=";
29 };
30
31 SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
32
33 build-system = [ hatchling ];
34
35 dependencies = [
36 deprecated
37 eval-type-backport
38 griffe
39 jinja2
40 platformdirs
41 pydantic
42 ];
43
44 optional-dependencies = {
45 all = [
46 litellm
47 redis
48 ];
49 };
50
51 nativeCheckInputs = [
52 pytest-asyncio
53 pytestCheckHook
54 ]
55 ++ lib.flatten (builtins.attrValues optional-dependencies);
56
57 pythonImportsCheck = [ "banks" ];
58
59 meta = {
60 description = "Module that provides tools and functions to build prompts text and chat messages from generic blueprints";
61 homepage = "https://github.com/masci/banks";
62 changelog = "https://github.com/masci/banks/releases/tag/${src.tag}";
63 license = lib.licenses.mit;
64 maintainers = with lib.maintainers; [ fab ];
65 };
66}