depot/third_party/nixpkgs/pkgs/development/python-modules/tokentrim/default.nix
Default email 23b612e36f Project import generated by Copybara.
GitOrigin-RevId: ae5c332cbb5827f6b1f02572496b141021de335f
2024-01-25 23:12:00 +09:00

39 lines
764 B
Nix

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