llm-gemini 0.18__py3-none-any.whl → 0.19__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llm-gemini
3
- Version: 0.18
3
+ Version: 0.19
4
4
  Summary: LLM plugin to access Google's Gemini family of models
5
5
  Author: Simon Willison
6
6
  License: Apache-2.0
@@ -66,6 +66,7 @@ llm "A joke about a pelican and a walrus"
66
66
 
67
67
  Other models are:
68
68
 
69
+ - `gemini-2.5-pro-preview-05-06` - latest paid Gemini 2.5 Pro preview
69
70
  - `gemini-2.5-flash-preview-04-17` - Gemini 2.5 Flash preview
70
71
  - `gemini-2.5-pro-exp-03-25` - free experimental release of Gemini 2.5 Pro
71
72
  - `gemini-2.5-pro-preview-03-25` - paid preview of Gemini 2.5 Pro
@@ -0,0 +1,7 @@
1
+ llm_gemini.py,sha256=RDPAY0wcCioPz-XeNMIXMah0lqHwGPeVlRnZLvTk4os,18457
2
+ llm_gemini-0.19.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
3
+ llm_gemini-0.19.dist-info/METADATA,sha256=u4XlQNQ2xVn3KRiDuvz2Tq33pqxbkFkFJl_ST5eYIQY,8117
4
+ llm_gemini-0.19.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
5
+ llm_gemini-0.19.dist-info/entry_points.txt,sha256=n544bpgUPIBc5l_cnwsTxPc3gMGJHPtAyqBNp-CkMWk,26
6
+ llm_gemini-0.19.dist-info/top_level.txt,sha256=WUQmG6_2QKbT_8W4HH93qyKl_0SUteL4Ra6_PhyNGKU,11
7
+ llm_gemini-0.19.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.3.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
llm_gemini.py CHANGED
@@ -36,7 +36,23 @@ GOOGLE_SEARCH_MODELS = {
36
36
  "gemini-1.5-flash-002",
37
37
  "gemini-2.0-flash-exp",
38
38
  "gemini-2.0-flash",
39
+ "gemini-2.5-pro-preview-03-25",
40
+ "gemini-2.5-pro-exp-03-25",
41
+ "gemini-2.5-flash-preview-04-17",
42
+ "gemini-2.5-pro-preview-05-06",
39
43
  }
44
+
45
+ # Older Google models used google_search_retrieval instead of google_search
46
+ GOOGLE_SEARCH_MODELS_USING_SEARCH_RETRIEVAL = {
47
+ "gemini-1.5-pro-latest",
48
+ "gemini-1.5-flash-latest",
49
+ "gemini-1.5-pro-001",
50
+ "gemini-1.5-flash-001",
51
+ "gemini-1.5-pro-002",
52
+ "gemini-1.5-flash-002",
53
+ "gemini-2.0-flash-exp",
54
+ }
55
+
40
56
  THINKING_BUDGET_MODELS = {
41
57
  "gemini-2.5-flash-preview-04-17",
42
58
  }
@@ -75,6 +91,8 @@ def register_models(register):
75
91
  "gemini-2.5-pro-preview-03-25",
76
92
  # 17th April 2025:
77
93
  "gemini-2.5-flash-preview-04-17",
94
+ # 6th May 2025:
95
+ "gemini-2.5-pro-preview-05-06",
78
96
  ]:
79
97
  can_google_search = model_id in GOOGLE_SEARCH_MODELS
80
98
  can_thinking_budget = model_id in THINKING_BUDGET_MODELS
@@ -285,7 +303,12 @@ class _SharedGemini:
285
303
  if prompt.options and prompt.options.code_execution:
286
304
  body["tools"] = [{"codeExecution": {}}]
287
305
  if prompt.options and self.can_google_search and prompt.options.google_search:
288
- body["tools"] = [{"google_search": {}}]
306
+ tool_name = (
307
+ "google_search_retrieval"
308
+ if self.model_id in GOOGLE_SEARCH_MODELS_USING_SEARCH_RETRIEVAL
309
+ else "google_search"
310
+ )
311
+ body["tools"] = [{tool_name: {}}]
289
312
  if prompt.system:
290
313
  body["systemInstruction"] = {"parts": [{"text": prompt.system}]}
291
314
 
@@ -490,9 +513,12 @@ def register_commands(cli):
490
513
  def models(key):
491
514
  "List of Gemini models pulled from their API"
492
515
  key = llm.get_key(key, "gemini", "LLM_GEMINI_KEY")
493
- response = httpx.get(
494
- f"https://generativelanguage.googleapis.com/v1beta/models?key={key}",
495
- )
516
+ if not key:
517
+ raise click.ClickException(
518
+ "You must set the LLM_GEMINI_KEY environment variable or use --key"
519
+ )
520
+ url = f"https://generativelanguage.googleapis.com/v1beta/models"
521
+ response = httpx.get(url, headers={"x-goog-api-key": key})
496
522
  response.raise_for_status()
497
523
  click.echo(json.dumps(response.json()["models"], indent=2))
498
524
 
@@ -1,7 +0,0 @@
1
- llm_gemini.py,sha256=eoMPxKnWgEN3Li1HDsKIgKnXT5AL4stDhWc1MU6uIRE,17558
2
- llm_gemini-0.18.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
3
- llm_gemini-0.18.dist-info/METADATA,sha256=X3NSwwbxo8TIAgyf3PA13WUzSWKTxXc38EhpD2VK_ds,8047
4
- llm_gemini-0.18.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
5
- llm_gemini-0.18.dist-info/entry_points.txt,sha256=n544bpgUPIBc5l_cnwsTxPc3gMGJHPtAyqBNp-CkMWk,26
6
- llm_gemini-0.18.dist-info/top_level.txt,sha256=WUQmG6_2QKbT_8W4HH93qyKl_0SUteL4Ra6_PhyNGKU,11
7
- llm_gemini-0.18.dist-info/RECORD,,