about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/tokentrim/default.nix
blob: c830d29b8a94448a1bad1f9b35fc90b7cd11a889 (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 {
  pname = "tokentrim";
  version = "unstable-2023-09-07";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "KillianLucas";
    repo = "tokentrim";
    rev = "e98ad3a2ca0e321a7347f76c30be584175495139";
    hash = "sha256-95xitHnbFFaj0xPuLMWvIvuJzoCO3VSd592X1RI9h3A=";
  };

  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 ];
  };
}