Files
nixpkgs/pkgs/development/python-modules/cohere/default.nix
2025-04-24 13:12:44 +00:00

60 lines
1.0 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
poetry-core,
# dependencies
fastavro,
httpx,
httpx-sse,
pydantic,
pydantic-core,
requests,
tokenizers,
types-requests,
typing-extensions,
}:
buildPythonPackage rec {
pname = "cohere";
version = "5.15.0";
pyproject = true;
src = fetchFromGitHub {
owner = "cohere-ai";
repo = "cohere-python";
tag = version;
hash = "sha256-X/6eAST9du6GT3j0d1xZuYfzN5p7rYlgGIIqv7V6vik=";
};
build-system = [ poetry-core ];
dependencies = [
fastavro
httpx
httpx-sse
pydantic
pydantic-core
requests
tokenizers
types-requests
typing-extensions
];
# tests require CO_API_KEY
doCheck = false;
pythonImportsCheck = [ "cohere" ];
meta = {
description = "Simplify interfacing with the Cohere API";
homepage = "https://docs.cohere.com/docs";
changelog = "https://github.com/cohere-ai/cohere-python/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
};
}