2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
google-ai-generativelanguage,
|
|
|
|
google-api-core,
|
|
|
|
google-api-python-client,
|
|
|
|
google-auth,
|
|
|
|
protobuf,
|
|
|
|
pydantic,
|
|
|
|
pythonOlder,
|
|
|
|
pythonRelaxDepsHook,
|
|
|
|
setuptools,
|
|
|
|
tqdm,
|
|
|
|
typing-extensions,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "google-generativeai";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "0.7.0";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "generative-ai-python";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-cK5Go5mFy+dC5/B4aMLDjZytNZn79r+ZvOEwAW0FPrI=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonRelaxDeps = [ "google-ai-generativelanguage" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pythonRelaxDepsHook ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2023-07-15 17:15:38 +00:00
|
|
|
google-ai-generativelanguage
|
2023-10-09 19:29:22 +00:00
|
|
|
google-api-core
|
2024-04-21 15:54:59 +00:00
|
|
|
google-api-python-client
|
|
|
|
google-auth
|
2023-10-09 19:29:22 +00:00
|
|
|
protobuf
|
2024-04-21 15:54:59 +00:00
|
|
|
pydantic
|
2023-10-09 19:29:22 +00:00
|
|
|
tqdm
|
2024-01-02 11:29:13 +00:00
|
|
|
typing-extensions
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Issue with the google.ai module. Check with the next release
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "google.generativeai" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|