2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, poetry-core
|
|
|
|
, pythonOlder
|
|
|
|
, requests
|
|
|
|
, aiohttp
|
|
|
|
, backoff
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cohere";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "4.9.0";
|
2023-05-24 13:37:59 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-4d89x+Pg5HZSUyxryH6OuMMGiMfeHXQX5Wy0XS++obY=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
requests
|
|
|
|
aiohttp
|
|
|
|
backoff
|
|
|
|
];
|
|
|
|
|
|
|
|
# tests require CO_API_KEY
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"cohere"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Simplify interfacing with the Cohere API";
|
|
|
|
homepage = "https://docs.cohere.com/docs";
|
|
|
|
changelog = "https://github.com/cohere-ai/cohere-python/blob/main/CHANGELOG.md#${builtins.replaceStrings ["."] [""] version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ natsukium ];
|
|
|
|
};
|
|
|
|
}
|