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