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