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 pydantic,
14 pydantic-core,
15 requests,
16 tokenizers,
17 types-requests,
18 typing-extensions,
19}:
20
21buildPythonPackage rec {
22 pname = "cohere";
23 version = "5.15.0";
24 pyproject = true;
25
26 src = fetchFromGitHub {
27 owner = "cohere-ai";
28 repo = "cohere-python";
29 tag = version;
30 hash = "sha256-X/6eAST9du6GT3j0d1xZuYfzN5p7rYlgGIIqv7V6vik=";
31 };
32
33 build-system = [ poetry-core ];
34
35 dependencies = [
36 fastavro
37 httpx
38 httpx-sse
39 pydantic
40 pydantic-core
41 requests
42 tokenizers
43 types-requests
44 typing-extensions
45 ];
46
47 # tests require CO_API_KEY
48 doCheck = false;
49
50 pythonImportsCheck = [ "cohere" ];
51
52 meta = {
53 description = "Simplify interfacing with the Cohere API";
54 homepage = "https://docs.cohere.com/docs";
55 changelog = "https://github.com/cohere-ai/cohere-python/releases/tag/${src.tag}";
56 license = lib.licenses.mit;
57 maintainers = with lib.maintainers; [ natsukium ];
58 };
59}