1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 tiktoken,
7}:
8
9buildPythonPackage rec {
10 pname = "tokentrim";
11 version = "0.1.13";
12 pyproject = true;
13
14 src = fetchFromGitHub {
15 owner = "KillianLucas";
16 repo = "tokentrim";
17 tag = "v${version}";
18 hash = "sha256-zr2SLT3MBuMD98g9fdS0mLuijcssRQ/S3+tCq2Cw1/4=";
19 };
20
21 nativeBuildInputs = [ poetry-core ];
22
23 propagatedBuildInputs = [ tiktoken ];
24
25 pythonImportsCheck = [ "tokentrim" ];
26
27 # tests connect to openai
28 doCheck = false;
29
30 meta = with lib; {
31 description = "Easily trim 'messages' arrays for use with GPTs";
32 homepage = "https://github.com/KillianLucas/tokentrim";
33 license = licenses.mit;
34 maintainers = with maintainers; [ happysalada ];
35 };
36}