1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 google-ai-generativelanguage,
6 google-api-core,
7 google-api-python-client,
8 google-auth,
9 protobuf,
10 pydantic,
11 pythonOlder,
12 setuptools,
13 tqdm,
14 typing-extensions,
15}:
16
17buildPythonPackage rec {
18 pname = "google-generativeai";
19 version = "0.8.5";
20 pyproject = true;
21
22 disabled = pythonOlder "3.9";
23
24 src = fetchFromGitHub {
25 owner = "google";
26 repo = "generative-ai-python";
27 tag = "v${version}";
28 hash = "sha256-wc35JSc98xvepI7Gpe5jSJ+c8n7WLKa96axoWVcH7UM=";
29 };
30
31 pythonRelaxDeps = [ "google-ai-generativelanguage" ];
32
33 build-system = [ setuptools ];
34
35 dependencies = [
36 google-ai-generativelanguage
37 google-api-core
38 google-api-python-client
39 google-auth
40 protobuf
41 pydantic
42 tqdm
43 typing-extensions
44 ];
45
46 # Issue with the google.ai module. Check with the next release
47 doCheck = false;
48
49 pythonImportsCheck = [ "google.generativeai" ];
50
51 meta = with lib; {
52 description = "Python client library for Google's large language model PaLM API";
53 homepage = "https://github.com/google/generative-ai-python";
54 changelog = "https://github.com/google/generative-ai-python/releases/tag/${src.tag}";
55 license = licenses.asl20;
56 maintainers = with maintainers; [ fab ];
57 };
58}