about summary refs log tree commit diff
path: root/pkgs/development/python-modules/tokentrim/default.nix
blob: 9588fadd6cb527ad8cb77f877ebb01ad87e14d3c (plain) (blame)
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
{ lib
, buildPythonPackage
, fetchFromGitHub
, poetry-core
, tiktoken
}:

buildPythonPackage rec {
  pname = "tokentrim";
  version = "0.1.13";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "KillianLucas";
    repo = pname;
    rev = "refs/tags/v${version}";
    hash = "sha256-zr2SLT3MBuMD98g9fdS0mLuijcssRQ/S3+tCq2Cw1/4=";
  };

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    tiktoken
  ];

  pythonImportsCheck = [ "tokentrim" ];

  # tests connect to openai
  doCheck = false;

  meta = with lib; {
    description = "Easily trim 'messages' arrays for use with GPTs";
    homepage = "https://github.com/KillianLucas/tokentrim";
    license = licenses.mit;
    maintainers = with maintainers; [ happysalada ];
  };
}