llm-gemini 0.14__py3-none-any.whl → 0.14.1__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.2
2
2
  Name: llm-gemini
3
- Version: 0.14
3
+ Version: 0.14.1
4
4
  Summary: LLM plugin to access Google's Gemini family of models
5
5
  Author: Simon Willison
6
6
  License: Apache-2.0
@@ -0,0 +1,7 @@
1
+ llm_gemini.py,sha256=eddn8U4kN2g9DOrotcKbyzNxGonR7XLiK7i_m7dgZ84,15296
2
+ llm_gemini-0.14.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
3
+ llm_gemini-0.14.1.dist-info/METADATA,sha256=jH04kG_VQYRVqjyVF2ZWHAWBqyxf-giSyX1NRO8ntss,7558
4
+ llm_gemini-0.14.1.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
5
+ llm_gemini-0.14.1.dist-info/entry_points.txt,sha256=n544bpgUPIBc5l_cnwsTxPc3gMGJHPtAyqBNp-CkMWk,26
6
+ llm_gemini-0.14.1.dist-info/top_level.txt,sha256=WUQmG6_2QKbT_8W4HH93qyKl_0SUteL4Ra6_PhyNGKU,11
7
+ llm_gemini-0.14.1.dist-info/RECORD,,
llm_gemini.py CHANGED
@@ -88,18 +88,24 @@ def resolve_type(attachment):
88
88
  return mime_type
89
89
 
90
90
 
91
- def cleanup_schema(schema):
91
+ def cleanup_schema(schema, in_properties=False):
92
92
  "Gemini supports only a subset of JSON schema"
93
93
  keys_to_remove = ("$schema", "additionalProperties", "title")
94
- # Recursively remove them
94
+
95
95
  if isinstance(schema, dict):
96
- for key in keys_to_remove:
97
- schema.pop(key, None)
98
- for value in schema.values():
99
- cleanup_schema(value)
96
+ # Only remove keys if we're not inside a 'properties' block.
97
+ if not in_properties:
98
+ for key in keys_to_remove:
99
+ schema.pop(key, None)
100
+ for key, value in list(schema.items()):
101
+ # If the key is 'properties', set the flag for its value.
102
+ if key == "properties" and isinstance(value, dict):
103
+ cleanup_schema(value, in_properties=True)
104
+ else:
105
+ cleanup_schema(value, in_properties=in_properties)
100
106
  elif isinstance(schema, list):
101
- for value in schema:
102
- cleanup_schema(value)
107
+ for item in schema:
108
+ cleanup_schema(item, in_properties=in_properties)
103
109
  return schema
104
110
 
105
111
 
@@ -1,7 +0,0 @@
1
- llm_gemini.py,sha256=KgiKMPY6q-GkAMzH0gfQWp0cjBBKizNhlnZ3nX5pXWY,14917
2
- llm_gemini-0.14.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
3
- llm_gemini-0.14.dist-info/METADATA,sha256=J8oA7hZmNrFsRyH3_s4oesSjWNEaK8pWcT2p-_quPTA,7556
4
- llm_gemini-0.14.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
5
- llm_gemini-0.14.dist-info/entry_points.txt,sha256=n544bpgUPIBc5l_cnwsTxPc3gMGJHPtAyqBNp-CkMWk,26
6
- llm_gemini-0.14.dist-info/top_level.txt,sha256=WUQmG6_2QKbT_8W4HH93qyKl_0SUteL4Ra6_PhyNGKU,11
7
- llm_gemini-0.14.dist-info/RECORD,,