2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, google-ai-generativelanguage
|
2023-10-09 19:29:22 +00:00
|
|
|
, google-api-core
|
|
|
|
, google-auth
|
|
|
|
, protobuf
|
2023-07-15 17:15:38 +00:00
|
|
|
, pythonOlder
|
|
|
|
, pythonRelaxDepsHook
|
2023-10-09 19:29:22 +00:00
|
|
|
, tqdm
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "google-generativeai";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.2.2";
|
2023-07-15 17:15:38 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "generative-ai-python";
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-WiDoeScro7TcW5nQBmLpVQriL6IzR9CAVqBj36nqivk=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"google-ai-generativelanguage"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
google-ai-generativelanguage
|
2023-10-09 19:29:22 +00:00
|
|
|
google-auth
|
|
|
|
google-api-core
|
|
|
|
protobuf
|
|
|
|
tqdm
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Issue with the google.ai module. Check with the next release
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"google.generativeai"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python client library for Google's large language model PaLM API";
|
|
|
|
homepage = "https://github.com/google/generative-ai-python";
|
|
|
|
changelog = "https://github.com/google/generative-ai-python/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|