python3Packages.anthropic: init at 0.2.7

This commit is contained in:
natsukium 2023-05-07 14:28:42 +09:00 committed by Yt
parent cb2941db79
commit bc8b4af988
2 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,53 @@
{ lib
, buildPythonPackage
, fetchPypi
, setuptools
, httpx
, importlib-metadata
, requests
, tokenizers
, aiohttp
, pythonOlder
}:
buildPythonPackage rec {
pname = "anthropic";
version = "0.2.7";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-2v3WF8eRIruXvFNjRRno3LoXt+dlpaI3LHf243RBJ+U=";
};
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
httpx
requests
tokenizers
aiohttp
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
];
# try downloading tokenizer in tests
# relates https://github.com/anthropics/anthropic-sdk-python/issues/24
doCheck = false;
pythonImportsCheck = [
"anthropic"
];
meta = with lib; {
description = "Anthropic's safety-first language model APIs";
homepage = "https://github.com/anthropics/anthropic-sdk-python";
changelog = "https://github.com/anthropics/anthropic-sdk-python/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ natsukium ];
};
}

View File

@ -516,6 +516,8 @@ self: super: with self; {
ansiwrap = callPackage ../development/python-modules/ansiwrap { };
anthropic = callPackage ../development/python-modules/anthropic { };
antlr4-python3-runtime = callPackage ../development/python-modules/antlr4-python3-runtime {
inherit (pkgs) antlr4;
};