letta-nightly 0.7.5.dev20250425104208__py3-none-any.whl → 0.7.5.dev20250426104040__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.
@@ -267,6 +267,41 @@ class GoogleAIClient(LLMClientBase):
267
267
  except KeyError as e:
268
268
  raise e
269
269
 
270
+ def _clean_google_ai_schema_properties(self, schema_part: dict):
271
+ """Recursively clean schema parts to remove unsupported Google AI keywords."""
272
+ if not isinstance(schema_part, dict):
273
+ return
274
+
275
+ # Per https://ai.google.dev/gemini-api/docs/function-calling?example=meeting#notes_and_limitations
276
+ # * Only a subset of the OpenAPI schema is supported.
277
+ # * Supported parameter types in Python are limited.
278
+ unsupported_keys = ["default", "exclusiveMaximum", "exclusiveMinimum"]
279
+ keys_to_remove_at_this_level = [key for key in unsupported_keys if key in schema_part]
280
+ for key_to_remove in keys_to_remove_at_this_level:
281
+ logger.warning(f"Removing unsupported keyword '{key_to_remove}' from schema part.")
282
+ del schema_part[key_to_remove]
283
+
284
+ if schema_part.get("type") == "string" and "format" in schema_part:
285
+ allowed_formats = ["enum", "date-time"]
286
+ if schema_part["format"] not in allowed_formats:
287
+ logger.warning(f"Removing unsupported format '{schema_part['format']}' for string type. Allowed: {allowed_formats}")
288
+ del schema_part["format"]
289
+
290
+ # Check properties within the current level
291
+ if "properties" in schema_part and isinstance(schema_part["properties"], dict):
292
+ for prop_name, prop_schema in schema_part["properties"].items():
293
+ self._clean_google_ai_schema_properties(prop_schema)
294
+
295
+ # Check items within arrays
296
+ if "items" in schema_part and isinstance(schema_part["items"], dict):
297
+ self._clean_google_ai_schema_properties(schema_part["items"])
298
+
299
+ # Check within anyOf, allOf, oneOf lists
300
+ for key in ["anyOf", "allOf", "oneOf"]:
301
+ if key in schema_part and isinstance(schema_part[key], list):
302
+ for item_schema in schema_part[key]:
303
+ self._clean_google_ai_schema_properties(item_schema)
304
+
270
305
  def convert_tools_to_google_ai_format(self, tools: List[Tool], llm_config: LLMConfig) -> List[dict]:
271
306
  """
272
307
  OpenAI style:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-nightly
3
- Version: 0.7.5.dev20250425104208
3
+ Version: 0.7.5.dev20250426104040
4
4
  Summary: Create LLM agents with long-term memory and custom tools
5
5
  License: Apache License
6
6
  Author: Letta Team
@@ -73,7 +73,7 @@ letta/llm_api/azure_openai.py,sha256=YAkXwKyfnJFNhB45pkJVFsoxUNB_M74rQYchtw_CN6I
73
73
  letta/llm_api/azure_openai_constants.py,sha256=ZaR2IasJThijG0uhLKJThrixdAxLPD2IojfeaJ-KQMQ,294
74
74
  letta/llm_api/cohere.py,sha256=IZ6LXyOFMYjWHTeNG9lvFxCdV_NIl0hY2q9SPFYXNkQ,14849
75
75
  letta/llm_api/deepseek.py,sha256=b1mSW8gnBrpAI8d2GcBpDyLYDnuC-P1UP6xJPalfQS4,12456
76
- letta/llm_api/google_ai_client.py,sha256=FGNmoMPV1ciZ6opeRcpSqgu_t9P66kM4aapaN0wfQpw,20792
76
+ letta/llm_api/google_ai_client.py,sha256=im-GeRpn9FhbdRHqW9EukW2O-LPvpfDkr1aZ9O2aXkE,22758
77
77
  letta/llm_api/google_constants.py,sha256=1dqwt-YwdYGnAHV5rIPfGHfE3ybPzSn_48vlNYfd-bk,588
78
78
  letta/llm_api/google_vertex_client.py,sha256=lTfAUTPSqwe-cuOoEgUehdwg2ZVHLqXRiu-sj6g8PJg,11645
79
79
  letta/llm_api/helpers.py,sha256=sLYv30UnKBRVPuhU_KDXfKFdbkUONiDAyVEwGr86l3A,16780
@@ -332,8 +332,8 @@ letta/streaming_utils.py,sha256=jLqFTVhUL76FeOuYk8TaRQHmPTf3HSRc2EoJwxJNK6U,1194
332
332
  letta/system.py,sha256=dnOrS2FlRMwijQnOvfrky0Lg8wEw-FUq2zzfAJOUSKA,8477
333
333
  letta/tracing.py,sha256=RstWXpfWVF77nmb_ISORVWd9IQw2Ky3de40k_S70yKI,8258
334
334
  letta/utils.py,sha256=IZFvtj9WYcrxUbkoUUYGDxMYQYdn5SgfqsvnARGsAzc,32245
335
- letta_nightly-0.7.5.dev20250425104208.dist-info/LICENSE,sha256=mExtuZ_GYJgDEI38GWdiEYZizZS4KkVt2SF1g_GPNhI,10759
336
- letta_nightly-0.7.5.dev20250425104208.dist-info/METADATA,sha256=WeqMXkmCYUka4wxlVOUi9CB9eVUtVbf2m3oXQ-4Ik6w,22282
337
- letta_nightly-0.7.5.dev20250425104208.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
338
- letta_nightly-0.7.5.dev20250425104208.dist-info/entry_points.txt,sha256=2zdiyGNEZGV5oYBuS-y2nAAgjDgcC9yM_mHJBFSRt5U,40
339
- letta_nightly-0.7.5.dev20250425104208.dist-info/RECORD,,
335
+ letta_nightly-0.7.5.dev20250426104040.dist-info/LICENSE,sha256=mExtuZ_GYJgDEI38GWdiEYZizZS4KkVt2SF1g_GPNhI,10759
336
+ letta_nightly-0.7.5.dev20250426104040.dist-info/METADATA,sha256=LFjhA8EEQOWmWwIneP1zo--Cw9iML8p8MSUAxXUYVjw,22282
337
+ letta_nightly-0.7.5.dev20250426104040.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
338
+ letta_nightly-0.7.5.dev20250426104040.dist-info/entry_points.txt,sha256=2zdiyGNEZGV5oYBuS-y2nAAgjDgcC9yM_mHJBFSRt5U,40
339
+ letta_nightly-0.7.5.dev20250426104040.dist-info/RECORD,,