1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 poetry-core,
6 pythonOlder,
7 fastavro,
8 httpx,
9 httpx-sse,
10 pydantic,
11 requests,
12 tokenizers,
13 types-requests,
14 typing-extensions,
15}:
16
17buildPythonPackage rec {
18 pname = "cohere";
19 version = "5.3.4";
20 pyproject = true;
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-tFoshbAl3RU2fWm/knSN5KMOyCq7Swj6UwG3LokFH+I=";
27 };
28
29 build-system = [ poetry-core ];
30
31 dependencies = [
32 fastavro
33 httpx
34 httpx-sse
35 pydantic
36 requests
37 tokenizers
38 types-requests
39 typing-extensions
40 ];
41
42 # tests require CO_API_KEY
43 doCheck = false;
44
45 pythonImportsCheck = [ "cohere" ];
46
47 meta = with lib; {
48 description = "Simplify interfacing with the Cohere API";
49 homepage = "https://docs.cohere.com/docs";
50 changelog = "https://github.com/cohere-ai/cohere-python/releases/tag/${version}";
51 license = licenses.mit;
52 maintainers = with maintainers; [ natsukium ];
53 };
54}