1{
2 aiohttp,
3 anyio,
4 buildPythonPackage,
5 fetchFromGitHub,
6 google-auth,
7 httpx,
8 lib,
9 packaging,
10 pkginfo,
11 pydantic,
12 pytestCheckHook,
13 requests,
14 setuptools,
15 twine,
16 typing-extensions,
17 websockets,
18}:
19
20buildPythonPackage rec {
21 pname = "google-genai";
22 version = "1.20.0";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "googleapis";
27 repo = "python-genai";
28 tag = "v${version}";
29 hash = "sha256-7DwLIK3/VCVSt9lq0Q0IRbhfLXOWw1TbPpDgI4jr9cg=";
30 };
31
32 build-system = [
33 packaging
34 pkginfo
35 setuptools
36 twine
37 ];
38
39 pythonRelaxDeps = [ "websockets" ];
40
41 dependencies = [
42 anyio
43 google-auth
44 httpx
45 pydantic
46 requests
47 typing-extensions
48 websockets
49 ];
50
51 optional-dependencies = {
52 aiohttp = [ aiohttp ];
53 };
54
55 pythonImportsCheck = [ "google.genai" ];
56
57 nativeCheckInputs = [
58 pytestCheckHook
59 ];
60
61 # ValueError: GOOGLE_GENAI_REPLAYS_DIRECTORY environment variable is not set
62 doCheck = false;
63
64 meta = {
65 changelog = "https://github.com/googleapis/python-genai/blob/${src.tag}/CHANGELOG.md";
66 description = "Google Generative AI Python SDK";
67 homepage = "https://github.com/googleapis/python-genai";
68 license = lib.licenses.asl20;
69 maintainers = with lib.maintainers; [ dotlambda ];
70 };
71}