depot/third_party/nixpkgs/pkgs/development/python-modules/tokentrim/default.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

39 lines
802 B
Nix

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