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