Skip to content

Commit 08f2d90

Browse files
committed
llm-gemini: init at 0.15
1 parent 0f80da4 commit 08f2d90

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
lib,
3+
callPackage,
4+
buildPythonPackage,
5+
fetchFromGitHub,
6+
setuptools,
7+
llm,
8+
httpx,
9+
ijson,
10+
pytestCheckHook,
11+
pytest-recording,
12+
pytest-asyncio,
13+
nest-asyncio,
14+
writableTmpDirAsHomeHook,
15+
}:
16+
buildPythonPackage rec {
17+
pname = "llm-gemini";
18+
version = "0.15";
19+
pyproject = true;
20+
21+
src = fetchFromGitHub {
22+
owner = "simonw";
23+
repo = "llm-gemini";
24+
tag = version;
25+
hash = "sha256-NNzorEb3dVoKef+9eXzStcFAkQhnhMBVnwLBc2lA2+o=";
26+
};
27+
28+
build-system = [
29+
setuptools
30+
];
31+
32+
dependencies = [
33+
llm
34+
httpx
35+
ijson
36+
];
37+
38+
nativeCheckInputs = [
39+
pytestCheckHook
40+
pytest-recording
41+
pytest-asyncio
42+
nest-asyncio
43+
writableTmpDirAsHomeHook
44+
];
45+
46+
pythonImportsCheck = [ "llm_gemini" ];
47+
48+
passthru.tests = {
49+
llm-plugin = callPackage ./tests/llm-plugin.nix { };
50+
};
51+
52+
meta = {
53+
description = "LLM plugin to access Google's Gemini family of models";
54+
homepage = "https://github.com/simonw/llm-gemini";
55+
changelog = "https://github.com/simonw/llm-gemini/releases/tag/${version}";
56+
license = lib.licenses.asl20;
57+
maintainers = with lib.maintainers; [ josh ];
58+
};
59+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
runCommand,
3+
python,
4+
yq,
5+
}:
6+
let
7+
venv = python.withPackages (ps: [
8+
ps.llm
9+
ps.llm-gemini
10+
]);
11+
in
12+
runCommand "llm-gemini-test-llm-plugin"
13+
{
14+
nativeBuildInputs = [
15+
venv
16+
yq
17+
];
18+
}
19+
''
20+
llm plugins | yq --exit-status 'any(.name == "llm-gemini")'
21+
touch "$out"
22+
''

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7816,6 +7816,8 @@ self: super: with self; {
78167816

78177817
llm-cmd = callPackage ../development/python-modules/llm-cmd { };
78187818

7819+
llm-gemini = callPackage ../development/python-modules/llm-gemini { };
7820+
78197821
llm-gguf = callPackage ../development/python-modules/llm-gguf { };
78207822

78217823
llm-jq = callPackage ../development/python-modules/llm-jq { };

0 commit comments

Comments
 (0)